Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/lilypond/builder.rb

Overview

Adds a ‘camelize_lower` method to the String class.

Instance Method Summary collapse

Instance Method Details

#camelize_lowerString

Converts an underscored string to camel case, except the first word remains downcase.

Examples

"my_foo".camelize_lower #=> "myFoo"

Returns:

  • (String)

    the camelized string



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