Method: Hanami::Utils::Hash.symbolize

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

.symbolize(input) ⇒ ::Hash

Symbolize the given hash

Examples:

Basic Usage

require 'hanami/utils/hash'

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

hash.class
  # => Hash

Parameters:

  • input (::Hash)

    the input

Returns:

  • (::Hash)

    the symbolized hash

See Also:

Since:

  • 1.0.1

[View source]

31
32
33
# File 'lib/hanami/utils/hash.rb', line 31

def self.symbolize(input)
  self[:symbolize_keys].call(input)
end