Class: Breadbox::S3Client
Instance Attribute Summary
Attributes inherited from Client
#configuration
Instance Method Summary
collapse
Methods inherited from Client
#client, #initialize, #root_path
Instance Method Details
#bucket ⇒ Object
6
7
8
|
# File 'lib/breadbox/s3_client.rb', line 6
def bucket
configuration.s3_bucket
end
|
#s3_bucket_object ⇒ Object
10
11
12
|
# File 'lib/breadbox/s3_client.rb', line 10
def s3_bucket_object
@bucket ||= AWS::S3.new.buckets[bucket]
end
|
#upload(path: nil, file: nil) ⇒ Object
14
15
16
17
|
# File 'lib/breadbox/s3_client.rb', line 14
def upload(path: nil, file: nil)
filepath = filepath_from_paths_and_file(root_path, path, file)[1..-1]
s3_bucket_object.objects[filepath].write(file)
end
|