Module: RiotRails::CoreExt::Hash

Defined in:
lib/riot/core_ext/hash.rb

Instance Method Summary collapse

Instance Method Details

#stringify_valuesObject



4
5
6
7
8
9
# File 'lib/riot/core_ext/hash.rb', line 4

def stringify_values
  inject({}) do |hsh,(key,val)|
    hsh[key] = val.respond_to?(:stringify_values) ? val.stringify_values : val.to_s
    hsh
  end
end

#stringify_values!Object



11
12
13
# File 'lib/riot/core_ext/hash.rb', line 11

def stringify_values!
  replace(stringify_values)
end