module Babl::Operators::Concat::DSL

Public Instance Methods

concat(*templates) click to toggle source

Produce an array by concatening the provided result of the given templates. (they therefor have to produce arrays, or nil, which is interpreted as an empty array)

# File lib/babl/operators/concat.rb, line 10
def concat(*templates)
    templates = templates.map { |t| unscoped.reset_continue.call(t) }

    construct_terminal { |context|
        Nodes::Concat.new(
            templates.map { |t|
                t.builder.precompile(
                    Nodes::TerminalValue.instance,
                    context
                )
            }
        )
    }
end