Module Enumerable
In: lib/facets/core-uncommon/facets/enumerable/has.rb

Methods

has?   have?  

Public Instance methods

The same as include?() but equality is tested using ===.

  [1, 2, "a"].has?(2)       #=> true
  [1, 2, "a"].has?(String)  #=> true
  [1, 2, "a"].has?(3)       #=> false

NOTE: This is not (presently) a common core extension and is not loaded automatically when using require ‘facets‘.

TODO: Perhaps matches? would be a better name?

CREDIT: Lavir the Whiolet

[Source]

# File lib/facets/core-uncommon/facets/enumerable/has.rb, line 15
  def has?(what)
    any? { |x| what === x }
  end
have?(what)

Alias for has?

[Validate]