1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

key?

Last updated at Posted at 2025-01-01

ハッシュのキーを探す

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?

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?