Class: Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository: 'file system', backup_folder: 'db/backups', file_suffix: '', aws_access_key_id: '', aws_secret_access_key: '', bucket: '', region: '', remote_path: '_backups/database/') ⇒ Configuration

Returns a new instance of Configuration.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/configuration.rb', line 5

def initialize(
  repository: 'file system',
  backup_folder: 'db/backups',
  file_suffix: '',
  aws_access_key_id: '',
  aws_secret_access_key: '',
  bucket: '',
  region: '',
  remote_path: '_backups/database/'
)
  @repository = repository
  @backup_folder = backup_folder
  @file_suffix = file_suffix
  @aws_access_key_id = aws_access_key_id
  @aws_secret_access_key = aws_secret_access_key
  @bucket = bucket
  @region = region
  @remote_path = remote_path
end

Instance Attribute Details

#aws_access_key_idObject

Returns the value of attribute aws_access_key_id.



2
3
4
# File 'lib/configuration.rb', line 2

def aws_access_key_id
  @aws_access_key_id
end

#aws_secret_access_keyObject

Returns the value of attribute aws_secret_access_key.



2
3
4
# File 'lib/configuration.rb', line 2

def aws_secret_access_key
  @aws_secret_access_key
end

#backup_folderObject

Returns the value of attribute backup_folder.



2
3
4
# File 'lib/configuration.rb', line 2

def backup_folder
  @backup_folder
end

#bucketObject

Returns the value of attribute bucket.



2
3
4
# File 'lib/configuration.rb', line 2

def bucket
  @bucket
end

#file_suffixObject

Returns the value of attribute file_suffix.



2
3
4
# File 'lib/configuration.rb', line 2

def file_suffix
  @file_suffix
end

#regionObject

Returns the value of attribute region.



2
3
4
# File 'lib/configuration.rb', line 2

def region
  @region
end

#remote_pathObject

Returns the value of attribute remote_path.



2
3
4
# File 'lib/configuration.rb', line 2

def remote_path
  @remote_path
end

#repositoryObject

Returns the value of attribute repository.



2
3
4
# File 'lib/configuration.rb', line 2

def repository
  @repository
end

Instance Method Details

#s3?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/configuration.rb', line 25

def s3?
  repository.downcase == 's3'
end