Class: Pageflow::Panorama::S3Bucket
- Inherits:
-
Object
- Object
- Pageflow::Panorama::S3Bucket
- Defined in:
- lib/pageflow/panorama/s3_bucket.rb
Defined Under Namespace
Classes: Factory, StreamWithSize
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
Instance Method Summary collapse
-
#initialize(bucket) ⇒ S3Bucket
constructor
A new instance of S3Bucket.
- #write(name:, input_stream:, content_length:, content_type:) ⇒ Object
Constructor Details
#initialize(bucket) ⇒ S3Bucket
Returns a new instance of S3Bucket.
6 7 8 |
# File 'lib/pageflow/panorama/s3_bucket.rb', line 6 def initialize(bucket) @bucket = bucket end |
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
4 5 6 |
# File 'lib/pageflow/panorama/s3_bucket.rb', line 4 def bucket @bucket end |
Instance Method Details
#write(name:, input_stream:, content_length:, content_type:) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/pageflow/panorama/s3_bucket.rb', line 10 def write(name:, input_stream:, content_length:, content_type:) object = bucket.object(name) object.put(body: StreamWithSize.new(input_stream, content_length), acl: 'public-read', content_type: content_type, content_length: content_length) end |