maicher/pg_export

View on GitHub
lib/pg_export/factories/ssh_gateway_factory.rb

Summary

Maintainability
A
20 mins
Test Coverage
# frozen_string_literal: true

require 'pg_export/gateways/ssh'

class PgExport
  module Factories
    class SshGatewayFactory
      def initialize(config:)
        @config = config
      end

      def gateway
        ::PgExport::Gateways::Ssh.new(
          host: config.gateway_host,
          user: config.gateway_user,
          password: config.gateway_password
        )
      end

      private

      attr_reader :config
    end
  end
end