Class: CarrierWave::Storage::AWSOptions
- Inherits:
-
Object
- Object
- CarrierWave::Storage::AWSOptions
- Defined in:
- lib/carrierwave/storage/aws_options.rb
Instance Attribute Summary collapse
-
#uploader ⇒ Object
readonly
Returns the value of attribute uploader.
Instance Method Summary collapse
- #expiration_options(options = {}) ⇒ Object
-
#initialize(uploader) ⇒ AWSOptions
constructor
A new instance of AWSOptions.
- #read_options ⇒ Object
- #write_options(new_file) ⇒ Object
Constructor Details
#initialize(uploader) ⇒ AWSOptions
Returns a new instance of AWSOptions.
8 9 10 |
# File 'lib/carrierwave/storage/aws_options.rb', line 8 def initialize(uploader) @uploader = uploader end |
Instance Attribute Details
#uploader ⇒ Object (readonly)
Returns the value of attribute uploader.
6 7 8 |
# File 'lib/carrierwave/storage/aws_options.rb', line 6 def uploader @uploader end |
Instance Method Details
#expiration_options(options = {}) ⇒ Object
24 25 26 27 28 |
# File 'lib/carrierwave/storage/aws_options.rb', line 24 def ( = {}) uploader_expiration = uploader.aws_authenticated_url_expiration { expires_in: uploader_expiration }.merge() end |
#read_options ⇒ Object
12 13 14 |
# File 'lib/carrierwave/storage/aws_options.rb', line 12 def end |
#write_options(new_file) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/carrierwave/storage/aws_options.rb', line 16 def (new_file) { acl: uploader.aws_acl, body: new_file.to_file, content_type: new_file.content_type }.merge(aws_attributes).merge() end |