Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/lilypond/builder.rb
Overview
Adds a ‘camelize_lower` method to the String class.
Instance Method Summary collapse
-
#camelize_lower ⇒ String
Converts an underscored string to camel case, except the first word remains downcase.
Instance Method Details
#camelize_lower ⇒ String
Converts an underscored string to camel case, except the first word remains downcase.
Examples
"my_foo".camelize_lower #=> "myFoo"
156 157 158 159 160 |
# File 'lib/lilypond/builder.rb', line 156 def camelize_lower self.split('_').map.with_index do |word, i| i == 0 ? word.downcase : word.capitalize end.join('') end |