Class: Fabulator::Expr::WithExpr

Inherits:
Object
  • Object
show all
Defined in:
lib/fabulator/expr/statement_list.rb

Instance Method Summary collapse

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