Sha256: 458dc016a0d101e23f2238197769d40a51c78b45a108a9a63945ed58e0c56154

Contents?: true

Size: 697 Bytes

Versions: 2

Compression:

Stored size: 697 Bytes

Contents

require 'pg_export/version'
require 'pg_export/configuration'
require 'pg_export/boot_container'
require 'pg_export/roles/interactive'
require 'pg_export/errors'
require 'pg_export/roles/validatable'

class PgExport
  include Roles::Validatable

  def initialize(**args)
    config = Configuration.new(**args)
    extend Roles::Interactive if config.interactive
    @container = BootContainer.call(config.to_h)
  rescue Dry::Struct::Error => e
    raise ArgumentError, e
  end

  def call(database_name, keep_dumps)
    container[:create_and_export_dump].call(
      validate_database_name(database_name),
      validate_keep_dumps(keep_dumps)
    )
  end

  private

  attr_reader :container
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pg_export-0.6.1 lib/pg_export.rb
pg_export-0.6.0 lib/pg_export.rb