class Tataru::Instructions::CheckInstruction

General checking class

Public Class Methods

new(check_type) click to toggle source
# File lib/tataru/instructions/check_instruction.rb, line 7
def initialize(check_type)
  @check_type = check_type
end

Public Instance Methods

after_complete(_memory) click to toggle source
# File lib/tataru/instructions/check_instruction.rb, line 23
def after_complete(_memory); end
run() click to toggle source
# File lib/tataru/instructions/check_instruction.rb, line 11
def run
  resource_class = desc.resource_class
  resource = resource_class.new(memory.hash[:remote_ids][resource_name])

  if resource.send(:"#{@check_type}_complete?")
    after_complete
  else
    # repeat this instruction until its done
    memory.program_counter -= 1
  end
end