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
22 23 24 |
# File 'lib/inflectious/string.rb', line 22 def adjectivize ActiveSupport::Inflector.adjectivize(self) end |
#doerize ⇒ Object
26 27 28 |
# File 'lib/inflectious/string.rb', line 26 def doerize ActiveSupport::Inflector.doerize(self) end |
#gerundize ⇒ Object
30 31 32 |
# File 'lib/inflectious/string.rb', line 30 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 20 |
# File 'lib/inflectious/string.rb', line 6 def inflections_with_names returning out = [] do out << [self, "self"] 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
34 35 36 |
# File 'lib/inflectious/string.rb', line 34 def participlize ActiveSupport::Inflector.participlize(self) end |
#stem ⇒ Object
42 43 44 |
# File 'lib/inflectious/string.rb', line 42 def stem ActiveSupport::Inflector.stem(self) end |
#superlativize(options = {}) ⇒ Object
38 39 40 |
# File 'lib/inflectious/string.rb', line 38 def superlativize(={}) ActiveSupport::Inflector.superlativize(self, ) end |