class Flor::Pro::If

Public Instance Methods

pre_execute() click to toggle source

removing “ife” and “unlesse” leads to LoadError: cannot load such file – sequel/adapters/ when running spec/unit/ and spec/punit/ weird…

# File lib/flor/pcore/if.rb, line 58
def pre_execute

  unatt_unkeyed_children
end
receive_non_att() click to toggle source
# File lib/flor/pcore/if.rb, line 63
def receive_non_att

  return wrap_reply if @fcid > first_unkeyed_child_id
    # "else" or "then" answered, replying to parent...

  off =
    case heap
    when 'unless', 'unlesse', '_unless'
      Flor.false?(payload['ret']) ? 1 : 2
    else # 'if' or 'ife'
      Flor.true?(payload['ret']) ? 1 : 2
    end

  nxt = @fcid + off

  if nxt >= children.size
    wrap_reply('ret' => node_payload_ret)
  else
    execute_child(nxt)
  end
end