Class: WhiskeyDisk::Config::StringifyHashKeysFilter
Instance Attribute Summary
#config
Instance Method Summary
collapse
#environment_name, #initialize, #project_name
Instance Method Details
#filter(data) ⇒ Object
19
20
21
|
# File 'lib/whiskey_disk/config/filters/stringify_hash_keys_filter.rb', line 19
def filter(data)
stringify(data)
end
|
#stringify(structure) ⇒ Object
14
15
16
17
|
# File 'lib/whiskey_disk/config/filters/stringify_hash_keys_filter.rb', line 14
def stringify(structure)
return structure.clone unless structure.respond_to? :keys
stringify_hash(structure)
end
|
#stringify_hash(data) ⇒ Object
6
7
8
9
10
11
12
|
# File 'lib/whiskey_disk/config/filters/stringify_hash_keys_filter.rb', line 6
def stringify_hash(data)
result = {}
data.each_pair do |key, value|
result[key.to_s] = stringify(value)
end
result
end
|