Sha256: 18c0ba4a1aa6e642292b181f5f787d5992b058ec4457c210f376b02a33b72a47

Contents?: true

Size: 656 Bytes

Versions: 9

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

require 'pg_export/container'

class PgExport
  class InitializationError < StandardError; end

  class << self
    def interactive
      PgExport::Container.start(:interactive)
      new(transaction: PgExport::Container['transactions.import_dump_interactively'])
    end

    def plain
      PgExport::Container.start(:plain)
      new(transaction: PgExport::Container['transactions.export_dump'])
    end
  end

  def initialize(transaction:)
    @transaction = transaction
  end

  def call(database_name, &block)
    transaction.call(database_name: database_name, &block)
  end

  private

  attr_reader :transaction
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
pg_export-1.0.0.rc3 lib/pg_export.rb
pg_export-1.0.0.rc2 lib/pg_export.rb
pg_export-1.0.0.rc1 lib/pg_export.rb
pg_export-0.7.7 lib/pg_export.rb
pg_export-0.7.6 lib/pg_export.rb
pg_export-0.7.5 lib/pg_export.rb
pg_export-0.7.4 lib/pg_export.rb
pg_export-0.7.3 lib/pg_export.rb
pg_export-0.7.2 lib/pg_export.rb