Module: Utilise::Augment::Hash

Included in:
Hash
Defined in:
lib/utilise/augment/hash.rb

Overview

Extends a hash to modify keys

Instance Method Summary collapse

Instance Method Details

#camel_keysObject

Transforms all keys to camel case



13
14
15
# File 'lib/utilise/augment/hash.rb', line 13

def camel_keys
  utilise_deep_transform_keys(self, &:camel)
end

#snake_keysObject

Transforms all keys to snake case



8
9
10
# File 'lib/utilise/augment/hash.rb', line 8

def snake_keys
  utilise_deep_transform_keys(self, &:snake)
end

#space_keysObject

Transforms all keys to space case



18
19
20
# File 'lib/utilise/augment/hash.rb', line 18

def space_keys
  utilise_deep_transform_keys(self, &:space)
end

#string_keysObject

Transforms all keys to a string



23
24
25
# File 'lib/utilise/augment/hash.rb', line 23

def string_keys
  utilise_deep_transform_keys(self, &:to_s)
end

#symbol_keysObject

Transforms all keys to a symbol



28
29
30
# File 'lib/utilise/augment/hash.rb', line 28

def symbol_keys
  utilise_deep_transform_keys(self, &:to_sym)
end