Sha256: ad21dc983b9eb86ce287cff3d12cb8ca968247067c77e946bebf97fd6341eb81

Contents?: true

Size: 509 Bytes

Versions: 2

Compression:

Stored size: 509 Bytes

Contents

# frozen_string_literal: true

require 'pg_export/value_objects/result'

class PgExport
  module Operations
    class OpenConnection
      def initialize(gateway_factory:)
        @gateway_factory = gateway_factory
      end

      def name
        :open_connection
      end

      def call(inputs)
        gateway = gateway_factory.gateway
        gateway.open

        ValueObjects::Success.new(inputs.merge(gateway: gateway))
      end

      private

      attr_reader :gateway_factory
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pg_export-1.0.0 lib/pg_export/operations/open_connection.rb
pg_export-1.0.0.rc8 lib/pg_export/operations/open_connection.rb