Class: Tataru::Instructions::CheckUpdateInstruction

Inherits:
CheckInstruction show all
Defined in:
lib/tataru/instructions/check_update_instruction.rb

Overview

check that update is completed

Instance Attribute Summary

Attributes inherited from Tataru::Instruction

#memory

Instance Method Summary collapse

Methods inherited from CheckInstruction

#run

Methods inherited from ResourceInstruction

#desc

Methods inherited from Tataru::Instruction

#execute, expects, #run

Constructor Details

#initializeCheckUpdateInstruction

Returns a new instance of CheckUpdateInstruction.



7
8
9
# File 'lib/tataru/instructions/check_update_instruction.rb', line 7

def initialize
  super :update
end

Instance Method Details

#after_completeObject



11
12
13
# File 'lib/tataru/instructions/check_update_instruction.rb', line 11

def after_complete
  memory.hash[:outputs][resource_name] = outputs
end

#outputsObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/tataru/instructions/check_update_instruction.rb', line 15

def outputs
  return {} unless desc.output_fields.count

  resource_class = desc.resource_class
  resource = resource_class.new(memory.hash[:remote_ids][resource_name])
  o = resource.outputs
  raise "Output for '#{resource_name}' is not a hash" unless o.is_a? Hash

  resource.outputs
end