Class: Tengu::Matcher
- Inherits:
-
Object
- Object
- Tengu::Matcher
- Defined in:
- lib/tengu/matcher.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
Instance Method Summary collapse
-
#initialize(description, &block) ⇒ Matcher
constructor
A new instance of Matcher.
- #matches?(object) ⇒ Boolean
Constructor Details
#initialize(description, &block) ⇒ Matcher
Returns a new instance of Matcher.
4 5 6 7 |
# File 'lib/tengu/matcher.rb', line 4 def initialize(description, &block) @description = description @block = block end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/tengu/matcher.rb', line 3 def description @description end |
Instance Method Details
#matches?(object) ⇒ Boolean
9 10 11 |
# File 'lib/tengu/matcher.rb', line 9 def matches?(object) @block.call(object) end |