Class: Poto::FileRepository::AWS::S3
- Inherits:
-
Object
- Object
- Poto::FileRepository::AWS::S3
- Defined in:
- lib/poto/file_repository/aws/s3.rb,
lib/poto/file_repository/aws/s3/client.rb,
lib/poto/file_repository/aws/s3/file_mapper.rb,
lib/poto/file_repository/aws/s3/file_collection_mapper.rb
Defined Under Namespace
Classes: Client, FileCollectionMapper, FileMapper
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #all(prefix:, page:, per_page:) ⇒ Object
-
#initialize(bucket:, client: Client.new(bucket)) ⇒ S3
constructor
A new instance of S3.
- #url(id) ⇒ Object
Constructor Details
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
9 10 11 |
# File 'lib/poto/file_repository/aws/s3.rb', line 9 def bucket @bucket end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
9 10 11 |
# File 'lib/poto/file_repository/aws/s3.rb', line 9 def client @client end |
Instance Method Details
#all(prefix:, page:, per_page:) ⇒ Object
20 21 22 23 24 25 26 27 28 |
# File 'lib/poto/file_repository/aws/s3.rb', line 20 def all(prefix:, page:, per_page:) objects = client.objects( page: page, per_page: per_page, prefix: prefix ) FileCollectionMapper.new(objects).call end |
#url(id) ⇒ Object
16 17 18 |
# File 'lib/poto/file_repository/aws/s3.rb', line 16 def url(id) client.url(id) end |