Class: S3ReproxyDownload::S3Object

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_reproxy_download.rb

Instance Method Summary collapse

Constructor Details

#initialize(bucket_name, path) ⇒ S3Object

Returns a new instance of S3Object.



31
32
33
34
# File 'lib/s3_reproxy_download.rb', line 31

def initialize(bucket_name, path)
  @bucket  = Aws::S3::Resource.new.bucket(bucket_name)
  @path    = path
end

Instance Method Details

#filenameObject



40
41
42
# File 'lib/s3_reproxy_download.rb', line 40

def filename
  File.basename(@path)
end

#presigned_urlObject



36
37
38
# File 'lib/s3_reproxy_download.rb', line 36

def presigned_url
  @bucket.object(@path).presigned_url(:get, @path)
end