class Tartarus::RemoteStorage::Glacier::Configuration
Constants
- DEFAULT_ACCOUNT_ID
- REQUIRED_ATTRIBUTES_NAMES
Public Class Methods
build(aws_key:, aws_secret:, aws_region:, account_id: DEFAULT_ACCOUNT_ID, vault_name:, root_path:, archive_registry_factory:)
click to toggle source
# File lib/tartarus/remote_storage/glacier/configuration.rb, line 12 def self.build(aws_key:, aws_secret:, aws_region:, account_id: DEFAULT_ACCOUNT_ID, vault_name:, root_path:, archive_registry_factory:) new.tap do |config| config.aws_key = aws_key config.aws_secret = aws_secret config.aws_region = aws_region config.account_id = account_id config.vault_name = vault_name config.root_path = root_path config.archive_registry_factory = archive_registry_factory config.validate! end end
Public Instance Methods
storage_directory()
click to toggle source
# File lib/tartarus/remote_storage/glacier/configuration.rb, line 29 def storage_directory "#{root_path}/tmp/tartarus/#{archive_registry_factory}" end
validate!()
click to toggle source
# File lib/tartarus/remote_storage/glacier/configuration.rb, line 25 def validate! validate_presence end
Private Instance Methods
validate_presence()
click to toggle source
# File lib/tartarus/remote_storage/glacier/configuration.rb, line 35 def validate_presence REQUIRED_ATTRIBUTES_NAMES.each do |attribute| raise ":#{attribute} must be present" if public_send(attribute).nil? end end