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.



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

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.



43
44
45
# File 'lib/ray/dsl/matcher.rb', line 43

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