Class: RulesProcessor::Processor
- Inherits:
-
Object
- Object
- RulesProcessor::Processor
- Defined in:
- lib/rules_processor/processor.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#records ⇒ Object
Returns the value of attribute records.
-
#ruleset ⇒ Object
Returns the value of attribute ruleset.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Processor
constructor
A new instance of Processor.
- #process ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Processor
Returns a new instance of Processor.
6 7 8 9 10 |
# File 'lib/rules_processor/processor.rb', line 6 def initialize(args = {}) @records = args[:records] @ruleset = args[:ruleset] = args[:options] end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/rules_processor/processor.rb', line 4 def end |
#records ⇒ Object
Returns the value of attribute records.
4 5 6 |
# File 'lib/rules_processor/processor.rb', line 4 def records @records end |
#ruleset ⇒ Object
Returns the value of attribute ruleset.
4 5 6 |
# File 'lib/rules_processor/processor.rb', line 4 def ruleset @ruleset end |
Instance Method Details
#process ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/rules_processor/processor.rb', line 12 def process ruleset.each do |rule| mark_skipped(rule) && next if already_matched?(rule) mark_not_match(rule) && next unless rule_matches?(rule) mark_match(rule) && actions_processor(rule) process break end matching_result end |