Sha256: 5d305d2f8cab42638fbeaff9db8e55246d33224ee7119be422953b85657f452c

Contents?: true

Size: 654 Bytes

Versions: 1

Compression:

Stored size: 654 Bytes

Contents

# frozen_string_literal: true

module Tataru
  module Instructions
    # instruction to check create
    class CheckCreateInstruction < CheckInstruction
      def initialize
        super :create
      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_create_instruction.rb