Class: Fabulator::Expr::SomeExpr

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

Instance Method Summary collapse

Methods inherited from ForExpr

#initialize

Constructor Details

This class inherits a constructor from Fabulator::Expr::ForExpr

Instance Method Details

#expr_type(context) ⇒ Object



47
48
49
# File 'lib/fabulator/expr/for_expr.rb', line 47

def expr_type(context)
  [ FAB_NS, 'boolean' ]
end

#run(context, autovivify = false) ⇒ Object



51
52
53
54
55
56
57
# File 'lib/fabulator/expr/for_expr.rb', line 51

def run(context, autovivify = false)
  result = super
  result.each do |r|
    return [ context.root.anon_node(true) ] if !!r.value
  end
  return [ context.root.anon_node(false) ]
end