Class: EZFormat::Hash
- Inherits:
-
Object
- Object
- EZFormat::Hash
- Defined in:
- lib/ezformat.rb
Class Method Summary collapse
Class Method Details
.to_snake_case(hash) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/ezformat.rb', line 4 def to_snake_case(hash) hash.map do |key, value| value = to_snake_case(value) if value.is_a?(::Hash) snake_cased_key = snake_case_key(key) [snake_cased_key, value] end.to_h end |