Class: Fabulator::Expr::Tuple
- Inherits:
-
Object
- Object
- Fabulator::Expr::Tuple
- Defined in:
- lib/fabulator/expr/function.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ Tuple
constructor
A new instance of Tuple.
- #run(context, autovivify = false) ⇒ Object
Constructor Details
#initialize(args) ⇒ Tuple
Returns a new instance of Tuple.
47 48 49 |
# File 'lib/fabulator/expr/function.rb', line 47 def initialize(args) @args = args end |
Instance Method Details
#run(context, autovivify = false) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/fabulator/expr/function.rb', line 51 def run(context, autovivify = false) items = @args.collect{ |arg| arg.run(context, autovivify).flatten }.flatten ret = context.root.anon_node(nil, [ FAB_NS, 'tuple' ]) ret.value = items ret.vtype = [ FAB_NS, 'tuple' ] ret.set_attribute('size', items.size) [ ret ] end |