class Hamster::Hash
def initialize(pairs = nil, &block)
- Yieldparam: key - Key that was not present in the hash.
Other tags:
- Yield: - Optional _default block_ to be stored and used to calculate the default value of a missing key. It will not be yielded during this method. It will not be preserved when marshalling.
Parameters:
-
pairs
(::Enumerable
) -- initial content of hash. An empty hash is returned if not provided.
def initialize(pairs = nil, &block) @trie = pairs ? Trie[pairs] : EmptyTrie @default = block end