Sha256: d678439ac32e7ff3c3f29a5c767c7872a3865d38ad94fc272014cc24711102f3
Contents?: true
Size: 713 Bytes
Versions: 3
Compression:
Stored size: 713 Bytes
Contents
# pops the top items of the +:name+ and +:int+ stacks; # pushes the +:name+ 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 +:name+, 1 +:int+ # # *pushes:* 1 +:name+ (sortof) # class NameShoveInstruction < Instruction include ShoveInstruction def initialize(context) super(context, :name) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
nudge-0.2.9 | lib/instructions/name/name_shove.rb |
nudge-0.2.8 | lib/instructions/name/name_shove.rb |
nudge-0.2.7 | lib/instructions/name/name_shove.rb |