Class: SbrfMerchant::Utils::String::ToCamelCase

Inherits:
Object
  • Object
show all
Defined in:
lib/sbrf_merchant/utils/string/to_camel_case.rb

Instance Method Summary collapse

Instance Method Details

#call(str) ⇒ Object



7
8
9
10
11
# File 'lib/sbrf_merchant/utils/string/to_camel_case.rb', line 7

def call(str)
  str.split('_').inject('') do |buffer, e|
    buffer + (buffer.empty? ? e : e.capitalize)
  end
end