Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/plural.rb
Instance Method Summary collapse
Instance Method Details
#plural ⇒ Object
53 54 55 56 57 58 59 60 61 62 |
# File 'lib/plural.rb', line 53 def plural result = self.dup if self.empty? || Plural.uncountables.any? { |i| result =~ /\b#{i}\Z/i } result else Plural.rules.each { |(rule, replacement)| break if result.gsub!(rule, replacement) } result end end |