Class: Ray::DSL::Matcher

Inherits:
Object
  • Object
show all
Defined in:
lib/ray/dsl/matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ Matcher

Returns a new instance of Matcher.



32
33
34
# File 'lib/ray/dsl/matcher.rb', line 32

def initialize(&block)
  @block = block
end

Instance Method Details

#match?(obj) ⇒ true, false Also known as: ===

True if the block this object was created with returns true when called with obj.

Returns:

  • (true, false)

    True if the block this object was created with returns true when called with obj.



38
39
40
# File 'lib/ray/dsl/matcher.rb', line 38

def match?(obj)
  @block.call(obj)
end