Class: Hash

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

Overview

Hash helpers

Instance Method Summary collapse

Instance Method Details

#cloneObject

#deep_freezeObject

Freeze all values in a hash

Returns:

  • Hash with all values frozen

#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

#deep_thawObject

#deep_thaw!Object

#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