Class: Smartdown::Engine::ConditionalResolver
- Inherits:
-
Object
- Object
- Smartdown::Engine::ConditionalResolver
- Defined in:
- lib/smartdown/engine/conditional_resolver.rb
Instance Method Summary collapse
- #call(node, state) ⇒ Object
-
#initialize(predicate_evaluator = nil) ⇒ ConditionalResolver
constructor
A new instance of ConditionalResolver.
Constructor Details
#initialize(predicate_evaluator = nil) ⇒ ConditionalResolver
Returns a new instance of ConditionalResolver.
6 7 8 |
# File 'lib/smartdown/engine/conditional_resolver.rb', line 6 def initialize(predicate_evaluator = nil) @predicate_evaluator = predicate_evaluator || PredicateEvaluator.new end |
Instance Method Details
#call(node, state) ⇒ Object
10 11 12 13 14 |
# File 'lib/smartdown/engine/conditional_resolver.rb', line 10 def call(node, state) node.dup.tap do |new_node| new_node.elements = resolve_conditionals(node.elements, state) end end |