Class: Pal::Operation::FilterEvaluator
- Inherits:
-
Object
- Object
- Pal::Operation::FilterEvaluator
- Defined in:
- lib/pal/operation/filter_evaluator.rb
Overview
Filter evaluator runs the filter processes to identify candidates
Instance Attribute Summary collapse
- #rule ⇒ Rule readonly
Instance Method Summary collapse
-
#initialize(filters) ⇒ FilterEvaluator
constructor
A new instance of FilterEvaluator.
- #test_property(row, column_headers) ⇒ Boolean
Constructor Details
#initialize(filters) ⇒ FilterEvaluator
Returns a new instance of FilterEvaluator.
14 15 16 |
# File 'lib/pal/operation/filter_evaluator.rb', line 14 def initialize(filters) @rule = RuleFactory.from_hash(filters) end |
Instance Attribute Details
#rule ⇒ Rule (readonly)
12 13 14 |
# File 'lib/pal/operation/filter_evaluator.rb', line 12 def rule @rule end |
Instance Method Details
#test_property(row, column_headers) ⇒ Boolean
21 22 23 24 25 26 |
# File 'lib/pal/operation/filter_evaluator.rb', line 21 def test_property(row, column_headers) return true if @rule.nil? eval_ctx = EvaluationContext.new(row, column_headers) @rule.evaluate(eval_ctx) end |