Module: Mondo::Utils

Extended by:
Utils
Included in:
Utils
Defined in:
lib/api/mondo/utils.rb

Instance Method Summary collapse

Instance Method Details

#camelize(str) ⇒ Object

String Helpers



8
9
10
# File 'lib/api/mondo/utils.rb', line 8

def camelize(str)
  str.split('_').map(&:capitalize).join
end

#underscore(str) ⇒ Object



12
13
14
# File 'lib/api/mondo/utils.rb', line 12

def underscore(str)
  str.gsub(/(.)([A-Z])/) { "#{$1}_#{$2.downcase}" }.downcase
end