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.



19
20
21
# File 'lib/ray/dsl/matcher.rb', line 19

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.



25
26
27
# File 'lib/ray/dsl/matcher.rb', line 25

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