Class: CodeYankInstruction
- Inherits:
-
Instruction
- Object
- Instruction
- CodeYankInstruction
- Includes:
- YankInstruction
- Defined in:
- lib/instructions/code/code_yank.rb
Overview
pops the top item of the :int
stack (the “index”); then repositions an item from down “inside” the :code
stack to its top.
If the index value is negative or 0, the bottom item on the stack is moved; if the index value is greater than or equal to the depth of the stack, there is no change; otherwise, the index value refers to the bottom-to-top order of stack items.
needs: 1 :int
, 1 :code
pushes: 1 :code
(sortof)
Instance Attribute Summary
Attributes included from YankInstruction
Attributes inherited from Instruction
Instance Method Summary collapse
-
#initialize(context) ⇒ CodeYankInstruction
constructor
A new instance of CodeYankInstruction.
Methods included from YankInstruction
#cleanup, #derive, #preconditions?, #setup
Methods inherited from Instruction
all_instructions, #cleanup, #derive, #go, inherited, #needs, #preconditions?, #pushes, #setup, to_nudgecode
Constructor Details
#initialize(context) ⇒ CodeYankInstruction
Returns a new instance of CodeYankInstruction.
15 16 17 |
# File 'lib/instructions/code/code_yank.rb', line 15 def initialize(context) super(context, :code) end |