Class: Bricolage::S3Writer
- Inherits:
-
Object
- Object
- Bricolage::S3Writer
- Defined in:
- lib/bricolage/s3writer.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(ds, key) ⇒ S3Writer
constructor
A new instance of S3Writer.
- #object ⇒ Object
- #upload(path) ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(ds, key) ⇒ S3Writer
Returns a new instance of S3Writer.
3 4 5 6 |
# File 'lib/bricolage/s3writer.rb', line 3 def initialize(ds, key) @ds = ds @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
12 13 14 |
# File 'lib/bricolage/s3writer.rb', line 12 def key @key end |
Instance Method Details
#object ⇒ Object
14 15 16 |
# File 'lib/bricolage/s3writer.rb', line 14 def object @object ||= @ds.object(@key) end |
#upload(path) ⇒ Object
18 19 20 |
# File 'lib/bricolage/s3writer.rb', line 18 def upload(path) object.upload_file(path) end |
#url ⇒ Object
8 9 10 |
# File 'lib/bricolage/s3writer.rb', line 8 def url @url ||= @ds.url(@key) end |