mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Splat options
This commit is contained in:
parent
2f15938587
commit
94a450acbe
1 changed files with 2 additions and 16 deletions
|
@ -4,22 +4,8 @@ require "active_support/core_ext/numeric/bytes"
|
|||
class ActiveStorage::Service::S3Service < ActiveStorage::Service
|
||||
attr_reader :client, :bucket
|
||||
|
||||
def initialize(access_key_id:, secret_access_key:, region:, bucket:, endpoint: nil)
|
||||
@client = if endpoint
|
||||
Aws::S3::Resource.new(
|
||||
access_key_id: access_key_id,
|
||||
secret_access_key: secret_access_key,
|
||||
region: region,
|
||||
endpoint: endpoint
|
||||
)
|
||||
else
|
||||
Aws::S3::Resource.new(
|
||||
access_key_id: access_key_id,
|
||||
secret_access_key: secret_access_key,
|
||||
region: region
|
||||
)
|
||||
end
|
||||
|
||||
def initialize(access_key_id:, secret_access_key:, region:, bucket:, **options)
|
||||
@client = Aws::S3::Resource.new(access_key_id: access_key_id, secret_access_key: secret_access_key, region: region, **options)
|
||||
@bucket = @client.bucket(bucket)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue