Class: Storage::Config
- Inherits:
-
Object
- Object
- Storage::Config
- Defined in:
- lib/storage/config.rb
Class Attribute Summary collapse
-
.access_key ⇒ Object
Set the S3 access key.
-
.bucket ⇒ Object
Set the S3 default bucket.
-
.path ⇒ Object
Set the FileSystem storage path.
-
.region ⇒ Object
Set the S3 region.
-
.secret_key ⇒ Object
Set the S3 secret key.
-
.strategy ⇒ Object
Set a storage strategy based on its registered name.
-
.strategy_class ⇒ Object
Set a storage class.
Class Method Summary collapse
Class Attribute Details
.access_key ⇒ Object
Set the S3 access key.
20 21 22 |
# File 'lib/storage/config.rb', line 20 def access_key @access_key end |
.bucket ⇒ Object
Set the S3 default bucket.
17 18 19 |
# File 'lib/storage/config.rb', line 17 def bucket @bucket end |
.path ⇒ Object
Set the FileSystem storage path.
29 30 31 |
# File 'lib/storage/config.rb', line 29 def path @path end |
.region ⇒ Object
Set the S3 region.
26 27 28 |
# File 'lib/storage/config.rb', line 26 def region @region end |
.secret_key ⇒ Object
Set the S3 secret key.
23 24 25 |
# File 'lib/storage/config.rb', line 23 def secret_key @secret_key end |
.strategy ⇒ Object
8 9 10 |
# File 'lib/storage/config.rb', line 8 def strategy @strategy end |
.strategy_class ⇒ Object
Set a storage class.
Storage::Config.strategy_class = Storage::Strategies::S3
14 15 16 |
# File 'lib/storage/config.rb', line 14 def strategy_class @strategy_class end |
Class Method Details
.get_class_for_strategy(strategy) ⇒ Object
39 40 41 42 |
# File 'lib/storage/config.rb', line 39 def self.get_class_for_strategy(strategy) Storage::Strategies::STRATEGIES[strategy].split('::') .reduce(Object) {|ns, class_name| ns.const_get(class_name) } end |