Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/apiway/extensions.rb
Instance Method Summary collapse
Instance Method Details
#camelize ⇒ Object
25 26 27 |
# File 'lib/apiway/extensions.rb', line 25 def camelize self.split( '_' ).collect( &:capitalize ).join end |
#underscore ⇒ Object
21 22 23 |
# File 'lib/apiway/extensions.rb', line 21 def underscore dup.tap { |s| s.underscore! } end |
#underscore! ⇒ Object
16 17 18 19 |
# File 'lib/apiway/extensions.rb', line 16 def underscore! gsub!( /(.)([A-Z])/, '\1_\2' ) downcase! end |