Module: Access

Extended by:
Access
Included in:
Access
Defined in:
lib/ex_aequo/kernel/access.rb

Instance Method Summary collapse

Instance Method Details

#any_key?(hash, *keys) ⇒ Boolean

Returns:

  • (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