Class: Fabulator::Expr::WithExpr
- Inherits:
-
Object
- Object
- Fabulator::Expr::WithExpr
- Defined in:
- lib/fabulator/expr/statement_list.rb
Instance Method Summary collapse
-
#initialize(e, w) ⇒ WithExpr
constructor
A new instance of WithExpr.
- #run(context, autovivify = false) ⇒ Object
Constructor Details
#initialize(e, w) ⇒ WithExpr
Returns a new instance of WithExpr.
81 82 83 84 |
# File 'lib/fabulator/expr/statement_list.rb', line 81 def initialize(e,w) @expr = e @with = w end |
Instance Method Details
#run(context, autovivify = false) ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/fabulator/expr/statement_list.rb', line 86 def run(context, autovivify = false) result = @expr.run(context, autovivify) result.each do |r| @with.run(context.with_root(r), true) end result end |