Method: Hanami::Utils::Hash.deep_stringify

Defined in:
lib/hanami/utils/hash.rb

.deep_stringify(input) ⇒ ::Hash

Deeply stringifies the given hash

Examples:

Basic Usage

require "hanami/utils/hash"

hash = Hanami::Utils::Hash.deep_stringify(foo: "bar", baz: {a: 1})
  # => {"foo"=>"bar", "baz"=>{"a"=>1}}

hash.class
  # => Hash

Parameters:

  • input (::Hash)

    the input

Returns:

  • (::Hash)

    the deep stringified hash

Since:

  • 1.1.1

[View source]

93
94
95
# File 'lib/hanami/utils/hash.rb', line 93

def self.deep_stringify(input)
  self[:deep_stringify_keys].call(input)
end