class Hash

Public Instance Methods

to_proc() click to toggle source

Convert Hash into a Proc that takes a key and returns the value of the Hash for that key.

@return [Proc]

# File lib/data/functions/hash.rb, line 5
def to_proc
  lambda do |k, *_|
    self.fetch(k, nil)
  end
end