Parent

Class/Module Index [+]

Quicksearch

WebMock::Util::HashKeysStringifier

Public Class Methods

stringify_keys!(arg) click to toggle source
# File lib/webmock/util/hash_keys_stringifier.rb, line 5
def self.stringify_keys!(arg)
  case arg
  when Array
    arg.map { |elem| stringify_keys!(elem) }
  when Hash
    Hash[
      *arg.map { |key, value|
        k = key.is_a?(Symbol) ? key.to_s : key
        v = stringify_keys!(value)
        [k,v]
      }.inject([]) {|r,x| r + x}]
  else
    arg
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.