Sha256: fb364c3e2de0c28d53bebc685cd52e43d810d0ca3a84af7d98188b7ff810ea0f

Contents?: true

Size: 453 Bytes

Versions: 1

Compression:

Stored size: 453 Bytes

Contents

# frozen_string_literal: true

module Tataru
  module Instructions
    # instruction to create
    class CreateInstruction < ResourceInstruction
      expects :properties

      def run
        resource_class = desc.resource_class
        resource = resource_class.new(nil)
        resource.create(properties)

        return unless desc.needs_remote_id?

        memory.hash[:remote_ids][resource_name] = resource.remote_id
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

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