Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/netsuite/core_ext/string/lower_camelcase.rb

Instance Method Summary collapse

Instance Method Details

#lower_camelcaseObject



2
3
4
5
6
7
8
# File 'lib/netsuite/core_ext/string/lower_camelcase.rb', line 2

def lower_camelcase
  str = dup
  str.gsub!(/\/(.?)/) { "::#{$1.upcase}" }
  str.gsub!(/(?:_+|-+)([a-z])/) { $1.upcase }
  str.gsub!(/(\A|\s)([A-Z])/) { $1 + $2.downcase }
  str
end