Class: BBAttributeFilters::Handlers::Symbol
- Inherits:
-
Object
- Object
- BBAttributeFilters::Handlers::Symbol
- Defined in:
- lib/bbattribute_filters/handlers/symbol.rb
Overview
Handler which passes the symbol provided to the evaluator
Instance Method Summary collapse
- #evaluate(evaluator) ⇒ Object
-
#initialize(symbol) ⇒ Symbol
constructor
A new instance of Symbol.
Constructor Details
#initialize(symbol) ⇒ Symbol
Returns a new instance of Symbol.
8 9 10 11 12 13 14 |
# File 'lib/bbattribute_filters/handlers/symbol.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/symbol.rb', line 16 def evaluate(evaluator) evaluator.public_send(@symbol) end |