Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/inflectious/string.rb
Instance Method Summary collapse
- #adjectivize ⇒ Object
- #doerize ⇒ Object
- #gerundize ⇒ Object
- #inflections ⇒ Object
- #inflections_with_names ⇒ Object
- #participlize ⇒ Object
- #stem ⇒ Object
- #superlativize(options = {}) ⇒ Object
Instance Method Details
#adjectivize ⇒ Object
21 22 23 |
# File 'lib/inflectious/string.rb', line 21 def adjectivize ActiveSupport::Inflector.adjectivize(self) end |
#doerize ⇒ Object
25 26 27 |
# File 'lib/inflectious/string.rb', line 25 def doerize ActiveSupport::Inflector.doerize(self) end |
#gerundize ⇒ Object
29 30 31 |
# File 'lib/inflectious/string.rb', line 29 def gerundize ActiveSupport::Inflector.gerundize(self) end |
#inflections ⇒ Object
2 3 4 |
# File 'lib/inflectious/string.rb', line 2 def inflections inflections_with_names.collect(&:first) end |
#inflections_with_names ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/inflectious/string.rb', line 6 def inflections_with_names returning out = [] do out << [singularize, "singularize"] out << [pluralize, "pluralize"] out << [participlize, "participlize"] out << [gerundize, "gerundize"] out << [gerundize.pluralize, "gerundize plural"] out << [doerize, "doerize"] out << [doerize.pluralize, "doerize plural"] out << [adjectivize, "adjectivize"] out << [superlativize, "superlativize"] out << [superlativize(:adjective => true), "superlativize adjective"] end end |
#participlize ⇒ Object
33 34 35 |
# File 'lib/inflectious/string.rb', line 33 def participlize ActiveSupport::Inflector.participlize(self) end |
#stem ⇒ Object
41 42 43 |
# File 'lib/inflectious/string.rb', line 41 def stem ActiveSupport::Inflector.stem(self) end |
#superlativize(options = {}) ⇒ Object
37 38 39 |
# File 'lib/inflectious/string.rb', line 37 def superlativize(={}) ActiveSupport::Inflector.superlativize(self, ) end |