Sha256: 89347a26985b326edbf7788cf32b4f929596cfa4cbda60110213daa04d8e44e1

Contents?: true

Size: 475 Bytes

Versions: 53

Compression:

Stored size: 475 Bytes

Contents

module WebMock
  module Util
    class HashKeysStringifier

      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

    end
  end
end

Version data entries

53 entries across 53 versions & 4 rubygems

Version Path
solidus_backend-1.0.0.pre3 vendor/bundle/gems/webmock-1.8.11/lib/webmock/util/hash_keys_stringifier.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/webmock-1.8.11/lib/webmock/util/hash_keys_stringifier.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/webmock-1.8.11/lib/webmock/util/hash_keys_stringifier.rb
whos_dated_who-0.1.0 vendor/bundle/gems/webmock-1.18.0/lib/webmock/util/hash_keys_stringifier.rb
whos_dated_who-0.0.1 vendor/bundle/gems/webmock-1.18.0/lib/webmock/util/hash_keys_stringifier.rb
webmock-1.18.0 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.17.4 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.17.3 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.17.2 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.17.1 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.17.0 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.16.1 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.16.0 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.15.2 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.15.0 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.14.0 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.13.0 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.12.3 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.12.2 lib/webmock/util/hash_keys_stringifier.rb
webmock-1.12.1 lib/webmock/util/hash_keys_stringifier.rb