Module: RotateInstruction

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#target_stackObject (readonly)

Returns the value of attribute target_stack.



191
192
193
# File 'lib/instructions/infrastructure.rb', line 191

def target_stack
  @target_stack
end

Instance Method Details

#cleanupObject



208
209
210
211
212
# File 'lib/instructions/infrastructure.rb', line 208

def cleanup
  pushes @target_stack, @arg2
  pushes @target_stack, @arg3
  pushes @target_stack, @arg1
end

#deriveObject



206
207
# File 'lib/instructions/infrastructure.rb', line 206

def derive
end

#initialize(context, target_stack) ⇒ Object



193
194
195
196
# File 'lib/instructions/infrastructure.rb', line 193

def initialize(context, target_stack)
  @target_stack = target_stack
  super(context)
end

#preconditions?Boolean

Returns:

  • (Boolean)


198
199
200
# File 'lib/instructions/infrastructure.rb', line 198

def preconditions?
  needs @target_stack, 3
end

#setupObject



201
202
203
204
205
# File 'lib/instructions/infrastructure.rb', line 201

def setup                           
  @arg3 = @context.pop(@target_stack)
  @arg2 = @context.pop(@target_stack)
  @arg1 = @context.pop(@target_stack)
end