Class: PresignedUpload::Configuration
- Inherits:
-
Object
- Object
- PresignedUpload::Configuration
- Defined in:
- lib/presigned_upload/configuration.rb
Overview
Configuration class
Constant Summary collapse
- AVAILABLE_STORAGES =
[:aws].freeze
Instance Attribute Summary collapse
-
#adapter_class ⇒ Object
readonly
Returns the value of attribute adapter_class.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#storage_options ⇒ Object
Returns the value of attribute storage_options.
Instance Method Summary collapse
- #configure! ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 16 |
# File 'lib/presigned_upload/configuration.rb', line 13 def initialize @storage = nil @storage_options = {} end |
Instance Attribute Details
#adapter_class ⇒ Object (readonly)
Returns the value of attribute adapter_class.
11 12 13 |
# File 'lib/presigned_upload/configuration.rb', line 11 def adapter_class @adapter_class end |
#storage ⇒ Object
Returns the value of attribute storage.
10 11 12 |
# File 'lib/presigned_upload/configuration.rb', line 10 def storage @storage end |
#storage_options ⇒ Object
Returns the value of attribute storage_options.
10 11 12 |
# File 'lib/presigned_upload/configuration.rb', line 10 def @storage_options end |
Instance Method Details
#configure! ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/presigned_upload/configuration.rb', line 18 def configure! unless AVAILABLE_STORAGES.include?(storage) raise InvalidStorage, "Invalid storage option. Allowed types are: #{AVAILABLE_STORAGES}" end raise InvalidStorageConfig, "Empty storage options configuration" if .empty? case storage when :aws load_aws end self end |