Skip to content
instance method

Hash#member?

(K arg0) -> bool
member?(p1)

Alias of #include?

Returns whether key is a key in self:

Example
h = {foo: 0, bar: 1, baz: 2}
h.include?(:bar) # => true
h.include?(:BAR) # => false

Related: Methods for Querying.

See also #include? #length #merge #keys also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0