Class: Ray::DSL::Matcher
- Inherits:
-
Object
- Object
- Ray::DSL::Matcher
- Defined in:
- lib/ray/dsl/matcher.rb
Instance Method Summary collapse
-
#initialize(&block) ⇒ Matcher
constructor
A new instance of Matcher.
-
#match?(obj) ⇒ true, false
(also: #===)
True if the block this object was created with returns true when called with obj.
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.
43 44 45 |
# File 'lib/ray/dsl/matcher.rb', line 43 def match?(obj) @block.call(obj) end |