Class: Hashish
Class Method Summary collapse
-
.array ⇒ Object
Return a new hash whose default value is an empty array; i.e.
-
.hash ⇒ Object
Return a new hash whose default value is an empty hash; i.e.
Class Method Details
.array ⇒ Object
Return a new hash whose default value is an empty array; i.e. querying any un-assigned key will assign and return an empty array to that key.
4 5 6 7 |
# File 'lib/babushka/core_patches/hashish.rb', line 4 def self.array Babushka::LogHelpers.deprecated! '2017-09-01', instead: "`Hash.new {|hsh,k| hsh[k] = [] }`" Hash.new {|hsh,k| hsh[k] = [] } end |
.hash ⇒ Object
Return a new hash whose default value is an empty hash; i.e. querying any un-assigned key will assign and return an empty hash to that key. Note that the empty hash is a regular hash and doesn’t have any default keys of its own.
12 13 14 15 |
# File 'lib/babushka/core_patches/hashish.rb', line 12 def self.hash Babushka::LogHelpers.deprecated! '2017-09-01', instead: "`Hash.new {|hsh,k| hsh[k] = {} }`" Hash.new {|hsh,k| hsh[k] = {} } end |