Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/invokable/hash.rb
Overview
Instance Method Summary collapse
-
#to_proc ⇒ Proc
Return a proc that takes a key and returns the value associated with it or nil if the key is not present in the hash.
Instance Method Details
#to_proc ⇒ Proc
Return a proc that takes a key and returns the value associated with it or nil if the key is not present in the hash.
10 11 12 13 14 |
# File 'lib/invokable/hash.rb', line 10 def to_proc lambda do |key| fetch(key) { nil } end end |