Class: RuleTable::ConfiguredMatcher
- Inherits:
-
Object
- Object
- RuleTable::ConfiguredMatcher
- Defined in:
- lib/rule_table.rb
Instance Attribute Summary collapse
-
#matcher_name ⇒ Object
readonly
Returns the value of attribute matcher_name.
Instance Method Summary collapse
-
#initialize(matcher_name, *args) ⇒ ConfiguredMatcher
constructor
A new instance of ConfiguredMatcher.
- #matches?(object) ⇒ Boolean
Constructor Details
#initialize(matcher_name, *args) ⇒ ConfiguredMatcher
Returns a new instance of ConfiguredMatcher.
71 72 73 74 75 |
# File 'lib/rule_table.rb', line 71 def initialize(matcher_name, *args) @matcher_name = matcher_name @matcher = RuleTable.matchers.fetch(matcher_name) @args = args end |
Instance Attribute Details
#matcher_name ⇒ Object (readonly)
Returns the value of attribute matcher_name.
69 70 71 |
# File 'lib/rule_table.rb', line 69 def matcher_name @matcher_name end |
Instance Method Details
#matches?(object) ⇒ Boolean
77 78 79 |
# File 'lib/rule_table.rb', line 77 def matches?(object) object.instance_exec(*@args, &@matcher) end |