Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/spectra/utilities.rb

Instance Method Summary collapse

Instance Method Details

#camelize(pascal) ⇒ Object



98
99
100
101
102
# File 'lib/spectra/utilities.rb', line 98

def camelize(pascal)
  self.split('_').map.with_index do |component, index| 
    !pascal && index == 0 ? component : component.capitalize 
  end.join('') 
end