Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/legato/core_ext/string.rb
Instance Method Summary collapse
- #camelize(first_letter = :upper) ⇒ Object (also: #camelcase)
- #demodulize ⇒ Object
- #underscore ⇒ Object
Instance Method Details
#camelize(first_letter = :upper) ⇒ Object Also known as: camelcase
4 5 6 7 8 9 |
# File 'lib/legato/core_ext/string.rb', line 4 def camelize(first_letter = :upper) case first_letter when :upper then Legato::Inflector.camelize(self, true) when :lower then Legato::Inflector.camelize(self, false) end end |
#demodulize ⇒ Object
16 17 18 |
# File 'lib/legato/core_ext/string.rb', line 16 def demodulize Legato::Inflector.demodulize(self) end |
#underscore ⇒ Object
12 13 14 |
# File 'lib/legato/core_ext/string.rb', line 12 def underscore Legato::Inflector.underscore(self) end |