Class: Tataru::Instructions::ReadInstruction
- Inherits:
-
ResourceInstruction
- Object
- Tataru::Instruction
- ResourceInstruction
- Tataru::Instructions::ReadInstruction
- Defined in:
- lib/tataru/instructions/read_instruction.rb
Overview
read properties of resource
Instance Attribute Summary
Attributes inherited from Tataru::Instruction
Instance Method Summary collapse
Methods inherited from ResourceInstruction
Methods inherited from Tataru::Instruction
Instance Method Details
#fields ⇒ Object
23 24 25 |
# File 'lib/tataru/instructions/read_instruction.rb', line 23 def fields @fields ||= desc.immutable_fields + desc.mutable_fields end |
#resource ⇒ Object
19 20 21 |
# File 'lib/tataru/instructions/read_instruction.rb', line 19 def resource resource_class.new(memory.hash[:remote_ids][resource_name]) end |
#resource_class ⇒ Object
15 16 17 |
# File 'lib/tataru/instructions/read_instruction.rb', line 15 def resource_class desc.resource_class end |
#run ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/tataru/instructions/read_instruction.rb', line 7 def run results = resource.read(fields) memory.hash[:temp][resource_name] = {} fields.each do |k| memory.hash[:temp][resource_name][k] = results[k] end end |