Class: Babl::Nodes::Concat

Inherits:
Object
  • Object
show all
Defined in:
lib/babl/nodes/concat.rb

Instance Method Summary collapse

Instance Method Details

#render(frame) ⇒ Object



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/babl/nodes/concat.rb', line 29

def render(frame)
    out = []
    nodes.each { |node|
        values = node.render(frame)
        case values
        when ::NilClass then nil
        when ::Array then out.concat(values)
        else raise Errors::RenderingError, "Only arrays can be concatenated\n" + frame.formatted_stack
        end
    }
    out
end