Class: ExecIfInstruction
- Inherits:
-
Instruction
- Object
- Instruction
- ExecIfInstruction
- Includes:
- IfInstruction
- Defined in:
- lib/instructions/exec/exec_if.rb
Overview
pops the top 2 items of the :exec
stack, and one :bool
; returns the top :exec
item if the :bool
is false
, the second one if true
needs: 2 :exec
, 1 :bool
pushes: 1 :exec
Instance Attribute Summary
Attributes included from IfInstruction
Attributes inherited from Instruction
Instance Method Summary collapse
-
#initialize(context) ⇒ ExecIfInstruction
constructor
A new instance of ExecIfInstruction.
Methods included from IfInstruction
#cleanup, #derive, #preconditions?, #setup
Methods inherited from Instruction
all_instructions, #cleanup, #derive, #go, inherited, #needs, #preconditions?, #pushes, #setup, to_nudgecode
Constructor Details
#initialize(context) ⇒ ExecIfInstruction
Returns a new instance of ExecIfInstruction.
13 14 15 |
# File 'lib/instructions/exec/exec_if.rb', line 13 def initialize(context) super(context, :exec) end |