Module: DepthInstruction

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#target_stackObject (readonly)

Returns the value of attribute target_stack.



217
218
219
# File 'lib/instructions/infrastructure.rb', line 217

def target_stack
  @target_stack
end

Instance Method Details

#cleanupObject



232
233
234
# File 'lib/instructions/infrastructure.rb', line 232

def cleanup
  pushes :int, @result
end

#deriveObject



229
230
231
# File 'lib/instructions/infrastructure.rb', line 229

def derive
  @result = ValuePoint.new("int",@context.stacks[@target_stack].depth.to_s)
end

#initialize(context, target_stack) ⇒ Object



219
220
221
222
# File 'lib/instructions/infrastructure.rb', line 219

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

#preconditions?Boolean

Returns:

  • (Boolean)


224
225
226
# File 'lib/instructions/infrastructure.rb', line 224

def preconditions?
  @context.stacks[@target_stack].depth != nil
end

#setupObject



227
228
# File 'lib/instructions/infrastructure.rb', line 227

def setup
end