class Poto::FileRepository::AWS::S3::Client

Attributes

bucket[R]

Public Class Methods

new(bucket) click to toggle source
# File lib/poto/file_repository/aws/s3/client.rb, line 10
def initialize(bucket)
  @bucket = bucket
end

Public Instance Methods

objects(prefix:, page:, per_page:) click to toggle source
# File lib/poto/file_repository/aws/s3/client.rb, line 14
def objects(prefix:, page:, per_page:)
  Aws::S3::Client.new.list_objects(
    bucket:   bucket,
    marker:   page,
    max_keys: per_page,
    prefix:   prefix
  )
end
url(key) click to toggle source
# File lib/poto/file_repository/aws/s3/client.rb, line 23
def url(key)
  Aws::S3::Object.new(
    bucket,
    key
  ).presigned_url(:get, expires_in: 3600)
end