class PgExport::Configuration

Public Class Methods

build(env) click to toggle source
# File lib/pg_export/configuration.rb, line 17
def self.build(env)
  new(
    dump_encryption_key: env['DUMP_ENCRYPTION_KEY'],
    ftp_host: env['BACKUP_FTP_HOST'],
    ftp_user: env['BACKUP_FTP_USER'],
    ftp_password: env['BACKUP_FTP_PASSWORD'],
    logger_format: env['LOGGER_FORMAT'] || 'plain',
    keep_dumps: env['KEEP_DUMPS'] || 10
  )
rescue Dry::Struct::Error => e
  raise PgExport::InitializationError, e.message.gsub('[PgExport::Configuration.new] ', '')
end

Public Instance Methods

logger_muted?() click to toggle source
# File lib/pg_export/configuration.rb, line 30
def logger_muted?
  logger_format == 'muted'
end