Class: Flor::Pro::If
- Inherits:
-
Flor::Procedure
- Object
- Node
- Flor::Procedure
- Flor::Pro::If
- Defined in:
- lib/flor/pcore/if.rb
Constant Summary
Constants inherited from Flor::Procedure
Flor::Procedure::RVARS, Flor::Procedure::TRUE_ATTS
Instance Attribute Summary
Attributes inherited from Node
Instance Method Summary collapse
-
#pre_execute ⇒ Object
removing “ife” and “unlesse” leads to LoadError: cannot load such file – sequel/adapters/ when running spec/unit/ and spec/punit/ weird…
- #receive_non_att ⇒ Object
Methods inherited from Flor::Procedure
[], core?, #debug_msg, #debug_tree, #end, #flank, #heap, inherited, make, names, #prepare_on_receive_last, #trigger_on_error
Methods inherited from Node
#child_id, #cnodes, #cnodes_any?, #cnodes_empty?, #deref, #descendant_of?, #domain, #exid, #fei, #from, #h, #initialize, #lookup_tree, #lookup_value, #message_or_node_payload, #nid, #node_closed?, #node_ended?, #node_open?, #node_payload, #node_payload_ret, #node_status, #node_status_flavour, #on_error_parent, #parent, #payload, #payload_ret, #point, #reheap, #to_procedure_node, #tree
Constructor Details
This class inherits a constructor from Flor::Node
Instance Method Details
#pre_execute ⇒ Object
removing “ife” and “unlesse” leads to LoadError: cannot load such file – sequel/adapters/ when running spec/unit/ and spec/punit/ weird…
79 80 81 82 |
# File 'lib/flor/pcore/if.rb', line 79 def pre_execute unatt_unkeyed_children end |
#receive_non_att ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/flor/pcore/if.rb', line 84 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 |