ハッシュのキーを探す
key?(key)
例に渡された引数と一致しているキーのあるかハッシュを調べる
Checks the hash for a key matching the argument passed in:
irb(main):001:0> hash = ActiveSupport::HashWithIndifferentAccess.new
=> {}
irb(main):002:0> hash['key'] = 'value'
=> "value"
irb(main):003:0> hash.key?(:key)
=> true
irb(main):004:0> hash.key?('key')
=> true
別名:`include?, has_key?, member?
Also aliased as: include?, has_key?, member?
memberはkey?のエイリアス
member?(key)Link
Alias for: key?