Class: Fabulator::Grammar::Actions::Result
- Inherits:
-
Action
- Object
- Action
- Fabulator::Grammar::Actions::Result
- Defined in:
- lib/fabulator/grammar/actions/result.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#select ⇒ Object
Returns the value of attribute select.
Instance Method Summary collapse
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/fabulator/grammar/actions/result.rb', line 5 def name @name end |
#select ⇒ Object
Returns the value of attribute select.
5 6 7 |
# File 'lib/fabulator/grammar/actions/result.rb', line 5 def select @select end |
Instance Method Details
#run(context, autovivify = false) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/fabulator/grammar/actions/result.rb', line 12 def run(context, autovivify = false) @context.with(context) do |ctx| values = self.has_actions? ? self.run_actions(ctx) : @select.run(ctx,false) if !values.nil? ctx.with_root(ctx.root.roots['result']).set_value(self.path, values) end end end |