Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/form_input/localize.rb

Overview

Primitive helper for converting hash keys to strings.

Instance Method Summary collapse

Instance Method Details

#stringify_keysObject

Convert all hash keys to strings recursively.



9
10
11
# File 'lib/form_input/localize.rb', line 9

def stringify_keys
  Hash[ map{ |k, v| [ k.to_s, v.respond_to?( :stringify_keys ) ? v.stringify_keys : v ] } ]
end