Module: Access
Instance Method Summary collapse
Instance Method Details
#any_key?(hash, *keys) ⇒ Boolean
6 7 8 9 |
# File 'lib/ex_aequo/kernel/access.rb', line 6 def any_key?(hash, *keys) keys.flatten.reduce(false) { |_, key| return true if hash[key] } false end |
#hash_by_key(hash) ⇒ Object
11 12 13 |
# File 'lib/ex_aequo/kernel/access.rb', line 11 def hash_by_key(hash) ->(key) { hash[key] } end |