Module: Dapp::Helper::CaseConversion

Defined in:
lib/dapp/helper/case_conversion.rb

Class Method Summary collapse

Class Method Details

.snake_case_to_camel_case(value) ⇒ Object



5
6
7
# File 'lib/dapp/helper/case_conversion.rb', line 5

def snake_case_to_camel_case(value)
  value.to_s.split('_').collect(&:capitalize).join
end

.snake_case_to_lower_camel_case(value) ⇒ Object



9
10
11
12
13
# File 'lib/dapp/helper/case_conversion.rb', line 9

def snake_case_to_lower_camel_case(value)
  res = snake_case_to_camel_case(value)
  res[0] = res[0].downcase
  res
end