Module: RiotRails::CoreExt::Hash

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) stringify_values



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

- (Object) stringify_values!



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

def stringify_values!
  replace(stringify_values)
end