lib/tori/backend/s3.rb in tori-0.2.0 vs lib/tori/backend/s3.rb in tori-0.3.0
- old
+ new
@@ -12,9 +12,18 @@
# And it use aws-sdk-core >= 2.0
# ENV takes precedence over credentials file and instance profile
#
# example:
# Tori.config.backend = Tori::Backend::S3.new(bucket: 'tori_bucket')
+ # # or
+ # Tori.config.backend = Tori::Backend::S3.new(
+ # bucket: 'tori_bucket',
+ # client: Aws::S3::Client.new(
+ # access_key_id: 'your_access_key',
+ # secret_access_key: 'your_secret_access_key',
+ # region: 'your-region-1'
+ # )
+ # )
def initialize(bucket:, client: nil)
@bucket = bucket
if client
unless client.kind_of?(Aws::S3::Client)
raise TypeError, "client should be instance of Aws::S3::Client or nil"