Method: String::Inflections.singular
- Defined in:
- lib/core_ext/string.rb
.singular(rule, replacement) ⇒ Array
Specifies a new singularization rule to transform plural words into singular forms. Adds the rule to the beginning of the rules array so it takes precedence over existing rules.
169 170 171 |
# File 'lib/core_ext/string.rb', line 169 def self.singular(rule, replacement) @singulars.insert(0, [rule, replacement]) end |