Method: Hash#stringify_keys
- Defined in:
- lib/fancybox2/core_ext/hash.rb
#stringify_keys ⇒ Object
Returns a new hash with all keys converted to strings.
hash = { name: 'Rob', age: '28' }
hash.stringify_keys
# => {"name"=>"Rob", "age"=>"28"}
55 56 57 |
# File 'lib/fancybox2/core_ext/hash.rb', line 55 def stringify_keys transform_keys { |key| key.to_s } end |