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.
Class Method Summary collapse
-
.key(name) ⇒ Ray::Key
A key object representing the key of that name.
-
.key_mod(name) ⇒ Ray::KeyMod
A key_mod object representing the mod combination of that name.
-
.where(&block) ⇒ DSL::Matcher
An anonymous matcher, using your block to know if the argument matches.
Class Method Details
.key(name) ⇒ Ray::Key
Returns A key object representing the key of that name.
24 25 26 |
# File 'lib/ray/dsl/matcher.rb', line 24 def key(name) Key.new(name) end |
.key_mod(name) ⇒ Ray::KeyMod
Returns A key_mod object representing the mod combination of that name.
30 31 32 |
# File 'lib/ray/dsl/matcher.rb', line 30 def key_mod(name) KeyMod.new(name) end |
.where(&block) ⇒ DSL::Matcher
Returns An anonymous matcher, using your block to know if the argument matches.
19 20 21 |
# File 'lib/ray/dsl/matcher.rb', line 19 def where(&block) DSL::Matcher.new { |o| block.call(o) } end |