Method: Hanami::Utils::Hash.deep_symbolize

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

.deep_symbolize(input) ⇒ ::Hash

Performs deep symbolize on the given hash

Examples:

Basic Usage

require 'hanami/utils/hash'

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

hash.class
  # => Hash

Parameters:

  • input (::Hash)

    the input

Returns:

  • (::Hash)

    the deep symbolized hash

See Also:

Since:

  • 1.0.1

[View source]

53
54
55
# File 'lib/hanami/utils/hash.rb', line 53

def self.deep_symbolize(input)
  self[:deep_symbolize_keys].call(input)
end