Class: RulesProcessor::ConditionMatcher
- Inherits:
-
Object
- Object
- RulesProcessor::ConditionMatcher
- Defined in:
- lib/rules_processor/condition_matcher.rb
Instance Attribute Summary collapse
-
#condition ⇒ Object
Returns the value of attribute condition.
-
#records ⇒ Object
Returns the value of attribute records.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ ConditionMatcher
constructor
A new instance of ConditionMatcher.
- #matches? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ ConditionMatcher
Returns a new instance of ConditionMatcher.
6 7 8 9 |
# File 'lib/rules_processor/condition_matcher.rb', line 6 def initialize(args = {}) @records = args[:records] @condition = OpenStruct.new(args[:condition]) end |
Instance Attribute Details
#condition ⇒ Object
Returns the value of attribute condition.
4 5 6 |
# File 'lib/rules_processor/condition_matcher.rb', line 4 def condition @condition end |
#records ⇒ Object
Returns the value of attribute records.
4 5 6 |
# File 'lib/rules_processor/condition_matcher.rb', line 4 def records @records end |
Instance Method Details
#matches? ⇒ Boolean
11 12 13 14 |
# File 'lib/rules_processor/condition_matcher.rb', line 11 def matches? klass = Object.const_get(klass_name) klass.new(records: records, condition: condition).perform end |