Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/doing/hash.rb

Overview

Hash helpers

Instance Method Summary collapse

Instance Method Details

#deep_freezedescription_of_the_return_value

Freeze all values in a hash

Returns:

  • (description_of_the_return_value)

#deep_freeze!Object

#deep_set(path, value) ⇒ Object

Set a nested hash value using an array

Examples:

{}.deep_set(['one', 'two'], 'value')

`=> { 'one' => { 'two' => 'value' } }

Parameters:

  • path (Array)

    key path

  • value

    The value

#stringify_keysObject

Turn all keys into string

Return a copy of the hash where all its keys are strings

#symbolize_keysObject

Turn all keys into symbols