Class: WellRested::CamelCaseFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/well_rested/camel_case_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(lower = true) ⇒ CamelCaseFormatter

Returns a new instance of CamelCaseFormatter.



3
4
5
# File 'lib/well_rested/camel_case_formatter.rb', line 3

def initialize(lower = true)
  raise "Upper case camelizing not supported yet" unless lower   # TODO: Support upper-camel-casing
end

Instance Method Details

#decode(hash) ⇒ Object



11
12
13
# File 'lib/well_rested/camel_case_formatter.rb', line 11

def decode(hash)
  KeyTransformer.underscore_keys(hash)
end

#encode(hash) ⇒ Object



7
8
9
# File 'lib/well_rested/camel_case_formatter.rb', line 7

def encode(hash)
  KeyTransformer.camelize_keys(hash)
end