Module: Awrence::Methods

Included in:
Array, Hash
Defined in:
lib/awrence/methods.rb

Instance Method Summary collapse

Instance Method Details

#to_camel_keys(value = self) ⇒ Object

Recursively converts Rubyish snake_case hash keys to CamelCase JSON-style hash keys suitable for use with a JSON API.



15
16
17
# File 'lib/awrence/methods.rb', line 15

def to_camel_keys(value = self)
  process_value(:to_camel_keys, value, first_upper: true)
end

#to_camelback_keys(value = self) ⇒ Object

Recursively converts Rubyish snake_case hash keys to camelBack JSON-style hash keys suitable for use with a JSON API.



8
9
10
# File 'lib/awrence/methods.rb', line 8

def to_camelback_keys(value = self)
  process_value(:to_camelback_keys, value, first_upper: false)
end