Sha256: bc69877ad5fb30455f7bc85717c808e78cac9e8c003a0a7de7e63a787b0151d8

Contents?: true

Size: 713 Bytes

Versions: 3

Compression:

Stored size: 713 Bytes

Contents

# pops the top items of the +:code+ and +:int+ stacks;
# pushes the +:code+ down "into" the stack, at a level determined by the +:int+ "destination" value.
# 
# If the destination value is negative or 0, the item stays on top;
# if the destination value is greater than or equal to the depth of the stack, the item goes to the bottom;
# otherwise, the item is inserted farther from the stack's top as the destination value increases.
# 
# note: the destination depth is calculated after the items have been popped
#
# *needs:* 1 +:code+, 1 +:int+
#
# *pushes:* 1 +:code+ (sortof)
#

class CodeShoveInstruction < Instruction
  include ShoveInstruction
  def initialize(context)
    super(context, :code)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nudge-0.2.9 lib/instructions/code/code_shove.rb
nudge-0.2.8 lib/instructions/code/code_shove.rb
nudge-0.2.7 lib/instructions/code/code_shove.rb