Module: NetSuite::Utilities::Strings

Defined in:
lib/netsuite/utilities/strings.rb

Class Method Summary collapse

Class Method Details

.lower_camelcase(obj) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/netsuite/utilities/strings.rb', line 5

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