Sha256: bfb1f12acea3a01da3e33fbc0da0fd894912e462e84bd8eb07fa138fe549b691

Contents?: true

Size: 666 Bytes

Versions: 2

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

require 'pg_export/version'
require 'pg_export/configuration'
require 'pg_export/configuration_parser'
require 'pg_export/commands_factory'

class PgExport
  def initialize(config)
    raise ArgumentError, 'config is not a PgExport::Configuration' unless config.is_a?(PgExport::Configuration)

    @command_name = config.command
    @database_name = config.database
    @commands_factory = PgExport::CommandsFactory.new(config: config)
  end

  def call
    commands_factory
      .public_send(command_name)
      .call(database_name: database_name)
  end

  private

  attr_reader :command_name, :database_name, :commands_factory
end

Version data entries

2 entries across 2 versions & 1 rubygems

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