Class: S3AssetsDeployer::AwsS3
- Inherits:
-
Object
- Object
- S3AssetsDeployer::AwsS3
- Defined in:
- lib/s3_assets_deployer/aws_s3.rb
Instance Method Summary collapse
-
#initialize(credentials:, region: nil, bucket: nil, prefix_key: nil) ⇒ AwsS3
constructor
A new instance of AwsS3.
- #upload(files) ⇒ Object
Constructor Details
#initialize(credentials:, region: nil, bucket: nil, prefix_key: nil) ⇒ AwsS3
Returns a new instance of AwsS3.
5 6 7 8 9 10 |
# File 'lib/s3_assets_deployer/aws_s3.rb', line 5 def initialize(credentials:, region: nil, bucket: nil, prefix_key: nil) @credentials = credentials @bucket = bucket @region = region @prefix_key = prefix_key end |
Instance Method Details
#upload(files) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/s3_assets_deployer/aws_s3.rb', line 12 def upload(files) files.each do |file| client.put_object( bucket: @bucket, key: [@prefix_key, file.key].compact.join('/'), body: file.body, content_type: file.content_type ) end end |