class Flor::Pro::Flatten

Public Instance Methods

pre_execute() click to toggle source
# File lib/flor/pcore/flatten.rb, line 20
def pre_execute

  @node['rets'] = []

  unatt_unkeyed_children
end
receive_last() click to toggle source
# File lib/flor/pcore/flatten.rb, line 27
def receive_last

  col = (@node['rets'] + [ node_payload_ret ])
    .find { |r| r.is_a?(Array) }

  lvl = @node['rets']
    .find { |r| r.is_a?(Integer) } || -1

  fail Flor::FlorError.new('missing collection', self) if col == nil

  wrap('ret' => col.flatten(lvl))
end