Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_ext/string.rb
Instance Method Summary collapse
-
#plural? ⇒ Boolean
I’m wondering the interface of linguistic, but I don’t wanna use ActiveSupport ‘box’.en.plural #=> ‘boxes’ ‘box’.en.plural_noun #=> ‘boxes’ ‘boxes’.en.plural #=> ‘box’ ‘boxes’.en.plural_noun #=> ‘boxess’ ‘carp’.en.plural #=> ‘carp’ ‘carp’.en.plural_noun #=> ‘carp’ See spec.
Instance Method Details
#plural? ⇒ Boolean
I’m wondering the interface of linguistic, but I don’t wanna use ActiveSupport ‘box’.en.plural #=> ‘boxes’ ‘box’.en.plural_noun #=> ‘boxes’ ‘boxes’.en.plural #=> ‘box’ ‘boxes’.en.plural_noun #=> ‘boxess’ ‘carp’.en.plural #=> ‘carp’ ‘carp’.en.plural_noun #=> ‘carp’ See spec.
10 11 12 13 14 15 16 |
# File 'lib/core_ext/string.rb', line 10 def plural? if self == self.en.plural # e.g. carp true else self.en.plural == self.en.plural_noun ? false : true end end |