Class: Pal::Operation::EvaluationContext
- Inherits:
-
Object
- Object
- Pal::Operation::EvaluationContext
- Defined in:
- lib/pal/operation/filter_evaluator.rb
Instance Attribute Summary collapse
-
#column_headers ⇒ Object
Returns the value of attribute column_headers.
-
#row ⇒ Object
Returns the value of attribute row.
Instance Method Summary collapse
- #get_value(key) ⇒ Object
-
#initialize(row, column_headers) ⇒ EvaluationContext
constructor
A new instance of EvaluationContext.
Constructor Details
#initialize(row, column_headers) ⇒ EvaluationContext
Returns a new instance of EvaluationContext.
238 239 240 241 |
# File 'lib/pal/operation/filter_evaluator.rb', line 238 def initialize(row, column_headers) @row = row @column_headers = column_headers end |
Instance Attribute Details
#column_headers ⇒ Object
Returns the value of attribute column_headers.
236 237 238 |
# File 'lib/pal/operation/filter_evaluator.rb', line 236 def column_headers @column_headers end |
#row ⇒ Object
Returns the value of attribute row.
236 237 238 |
# File 'lib/pal/operation/filter_evaluator.rb', line 236 def row @row end |
Instance Method Details
#get_value(key) ⇒ Object
243 244 245 246 |
# File 'lib/pal/operation/filter_evaluator.rb', line 243 def get_value(key) idx = @column_headers.fetch(key, -1) idx.zero? || idx.positive? ? @row[idx] : nil end |