method
key?
v4.2.7 -
Show latest stable
- Class:
ActiveSupport::HashWithIndifferentAccess
key?(key)public
Checks the hash for a key matching the argument passed in:
hash = ActiveSupport::HashWithIndifferentAccess.new hash['key'] = 'value' hash.key?(:key) # => true hash.key?('key') # => true