Class: Vanguard::Matcher::Nullary::Proc
- Inherits:
-
Vanguard::Matcher::Nullary
- Object
- Vanguard::Matcher
- Vanguard::Matcher::Nullary
- Vanguard::Matcher::Nullary::Proc
- Defined in:
- lib/vanguard/matcher/nullary/proc.rb
Overview
A matcher that delegates to block
Instance Attribute Summary collapse
-
#block ⇒ Proc
readonly
private
Return block.
Instance Method Summary collapse
-
#initialize(block) ⇒ undefined
constructor
private
Initialize object.
-
#matches?(input) ⇒ true, false
Test if value matches.
Constructor Details
#initialize(block) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize object
37 38 39 |
# File 'lib/vanguard/matcher/nullary/proc.rb', line 37 def initialize(block) @block = block end |
Instance Attribute Details
#block ⇒ Proc (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return block
15 16 17 |
# File 'lib/vanguard/matcher/nullary/proc.rb', line 15 def block @block end |
Instance Method Details
#matches?(input) ⇒ true, false
Test if value matches
25 26 27 |
# File 'lib/vanguard/matcher/nullary/proc.rb', line 25 def matches?(input) !!@block.call(input) end |