Module: Ray::Matchers

Included in:
Helper
Defined in:
lib/ray/dsl/matcher.rb

Overview

This is the module including all of your matchers as private methods, allowing you to use them when you call on.

Instance Method Summary collapse

Instance Method Details

#where(&block) ⇒ DSL::Matcher

Returns An anonymous matcher, using your block to know if the argument matches.

Examples:

on :foo, where { |i| i > 10 } do |i|
  puts "#{i} is greater than 10!"
end

Returns:

  • (DSL::Matcher)

    An anonymous matcher, using your block to know if the argument matches.



12
13
14
# File 'lib/ray/dsl/matcher.rb', line 12

def where(&block)
  DSL::Matcher.new { |o| block.call(o) }
end