Class: BBAttributeFilters::Handlers::Evaluation

Inherits:
Object
  • Object
show all
Defined in:
lib/bbattribute_filters/handlers/evaluation.rb

Overview

Handler which passes the name of the attribute directly to the BBAttributeFilter via the evaluate_attribute

Instance Method Summary collapse

Constructor Details

#initialize(symbol) ⇒ Evaluation

Returns a new instance of Evaluation.



8
9
10
11
12
13
14
# File 'lib/bbattribute_filters/handlers/evaluation.rb', line 8

def initialize(symbol)
  unless symbol.is_a?(::Symbol)
    raise ArgumentError, 'BBAttributeFilters::Handlers::EvaluationHandler - Expected a Symbol'
  end

  @symbol = symbol
end

Instance Method Details

#evaluate(evaluator) ⇒ Object



16
17
18
# File 'lib/bbattribute_filters/handlers/evaluation.rb', line 16

def evaluate(evaluator)
  evaluator.evaluate_attribute(@symbol)
end