Sha256: bf9cf2596760e3079b4b0b401874f21153f0d40f260642716a6454ad156e6360

Contents?: true

Size: 657 Bytes

Versions: 1

Compression:

Stored size: 657 Bytes

Contents

# frozen_string_literal: true

module Tataru
  module Instructions
    # check that update is completed
    class CheckUpdateInstruction < CheckInstruction
      def initialize
        super :update
      end

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

      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tataru-0.2.0 lib/tataru/instructions/check_update_instruction.rb