Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Extended by:
- FatCore::Hash::ClassMethods
- Includes:
- FatCore::Hash
- Defined in:
- lib/fat_core/hash.rb
Deletion collapse
-
#delete_with_value(v) ⇒ Hash
included
from FatCore::Hash
Remove from the hash all keys that have values == to given value or that include the given value if the hash has an Enumerable for a value.
Enumerable Extensions collapse
-
#each_pair_with_flags ⇒ Hash
included
from FatCore::Hash
Yield each key-value pair in the Hash together with two boolean flags that indicate whether the item is the first or last item in the Hash.
Key Manipulation collapse
-
#keys_with_value(val) ⇒ Array<Object>
included
from FatCore::Hash
Return all keys in hash that have a value == to the given value or have an Enumerable value that includes the given value.
-
#remap_keys(key_map = {}) ⇒ Hash
included
from FatCore::Hash
Change each key of this Hash to its value in
key_map
. -
#replace_keys(new_keys) ⇒ Hash
included
from FatCore::Hash
Change the keys of this Hash to new_keys, an array of keys of the same size as the Array self.keys.
Instance Method Details
permalink #delete_with_value(v) ⇒ Hash Originally defined in module FatCore::Hash
Remove from the hash all keys that have values == to given value or that include the given value if the hash has an Enumerable for a value
permalink #each_pair_with_flags ⇒ Hash Originally defined in module FatCore::Hash
Yield each key-value pair in the Hash together with two boolean flags that indicate whether the item is the first or last item in the Hash.
permalink #keys_with_value(val) ⇒ Array<Object> Originally defined in module FatCore::Hash
Return all keys in hash that have a value == to the given value or have an Enumerable value that includes the given value.
permalink #remap_keys(key_map = {}) ⇒ Hash Originally defined in module FatCore::Hash
Change each key of this Hash to its value in key_map
. Keys not appearing in
the key_map
remain in the result Hash.
permalink #replace_keys(new_keys) ⇒ Hash Originally defined in module FatCore::Hash
Change the keys of this Hash to new_keys, an array of keys of the same size as the Array self.keys.