Sha256: b5d1b244f3285a87ac319a67b402d8cdb0e17f905d2b12bacdcae9ce3498cdae

Contents?: true

Size: 461 Bytes

Versions: 68

Compression:

Stored size: 461 Bytes

Contents

module Rollbar
  module Util
    module Hash
      def self.deep_stringify_keys(hash)
        hash.reduce({}) do |h, (key, value)|
          h[key.to_s] = map_value(value, :deep_stringify_keys)

          h
        end
      end

      def self.map_value(thing, m)
        case thing
        when ::Hash
          send(m, thing)
        when Array
          thing.map { |v| map_value(v, m) }
        else
          thing
        end
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
rollbar-2.5.2 lib/rollbar/util/hash.rb
rollbar-2.5.1 lib/rollbar/util/hash.rb
rollbar-2.5.0 lib/rollbar/util/hash.rb
rollbar-2.4.0 lib/rollbar/util/hash.rb
rollbar-2.3.0 lib/rollbar/util/hash.rb
rollbar-2.2.1 lib/rollbar/util/hash.rb
rollbar-2.2.0 lib/rollbar/util/hash.rb
rollbar-2.1.2 lib/rollbar/util/hash.rb
rollbar-2.1.1 lib/rollbar/util/hash.rb
rollbar-2.1.0 lib/rollbar/util/hash.rb
rollbar-2.0.2 lib/rollbar/util/hash.rb
rollbar-2.0.1 lib/rollbar/util/hash.rb
rollbar-2.0.0 lib/rollbar/util/hash.rb
rollbar-1.5.3 lib/rollbar/util/hash.rb
rollbar-1.5.2 lib/rollbar/util/hash.rb
rollbar-1.5.1 lib/rollbar/util/hash.rb
rollbar-1.5.0 lib/rollbar/util/hash.rb
rollbar-1.4.5 lib/rollbar/util/hash.rb
rollbar-1.4.4 lib/rollbar/util/hash.rb
rollbar-1.4.3 lib/rollbar/util/hash.rb