Class: Tataru::Instructions::CheckInstruction
- Inherits:
-
ResourceInstruction
- Object
- Tataru::Instruction
- ResourceInstruction
- Tataru::Instructions::CheckInstruction
- Defined in:
- lib/tataru/instructions/check_instruction.rb
Overview
General checking class
Direct Known Subclasses
CheckCreateInstruction, CheckDeleteInstruction, CheckUpdateInstruction
Instance Attribute Summary
Attributes inherited from Tataru::Instruction
Instance Method Summary collapse
- #after_complete(_memory) ⇒ Object
-
#initialize(check_type) ⇒ CheckInstruction
constructor
A new instance of CheckInstruction.
- #run ⇒ Object
Methods inherited from ResourceInstruction
Methods inherited from Tataru::Instruction
Constructor Details
#initialize(check_type) ⇒ CheckInstruction
Returns a new instance of CheckInstruction.
7 8 9 |
# File 'lib/tataru/instructions/check_instruction.rb', line 7 def initialize(check_type) @check_type = check_type end |
Instance Method Details
#after_complete(_memory) ⇒ Object
23 |
# File 'lib/tataru/instructions/check_instruction.rb', line 23 def after_complete(_memory); end |
#run ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# 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 |