Class: Bkblz::MapKeyFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/bkblz/map_key_formatter.rb

Class Method Summary collapse

Class Method Details

.camelcase_keys(map) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/bkblz/map_key_formatter.rb', line 13

def self.camelcase_keys(map)
  modified_map = {}
  map.each do |k,v|
    modified_map[k.to_s.camelcase.to_sym] = v
  end
  modified_map
end

.underscore_keys(map) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/bkblz/map_key_formatter.rb', line 5

def self.underscore_keys(map)
  modified_map = {}
  map.each do |k,v|
    modified_map[k.to_s.underscore.to_sym] = v
  end
  modified_map
end