Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/utils/string.rb
Instance Method Summary collapse
-
#camelize ⇒ Object
Reshape a string.
Instance Method Details
#camelize ⇒ Object
Reshape a string
6 7 8 9 10 11 12 |
# File 'lib/utils/string.rb', line 6 def camelize return self.strip unless self =~ /_/ x = self.strip.split( '_' ) s = x.shift s << ( x.map{|seg| seg.capitalize }.join('') ) s end |