Class: RulesProcessor::RuleMatcher
- Inherits:
-
Object
- Object
- RulesProcessor::RuleMatcher
- Defined in:
- lib/rules_processor/rule_matcher.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#records ⇒ Object
Returns the value of attribute records.
-
#rule ⇒ Object
Returns the value of attribute rule.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ RuleMatcher
constructor
A new instance of RuleMatcher.
- #matches? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ RuleMatcher
Returns a new instance of RuleMatcher.
6 7 8 9 10 |
# File 'lib/rules_processor/rule_matcher.rb', line 6 def initialize(args = {}) @records = args[:records] @rule = args[:rule] @options = args[:options] end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/rules_processor/rule_matcher.rb', line 4 def @options end |
#records ⇒ Object
Returns the value of attribute records.
4 5 6 |
# File 'lib/rules_processor/rule_matcher.rb', line 4 def records @records end |
#rule ⇒ Object
Returns the value of attribute rule.
4 5 6 |
# File 'lib/rules_processor/rule_matcher.rb', line 4 def rule @rule end |
Instance Method Details
#matches? ⇒ Boolean
12 13 14 15 |
# File 'lib/rules_processor/rule_matcher.rb', line 12 def matches? return false if both_condition_group_empty? meet_all_matches? || meet_any_matches? end |