Class: Takenoko::S3::Client
- Inherits:
-
Object
- Object
- Takenoko::S3::Client
- Defined in:
- lib/takenoko/s3/client.rb
Instance Method Summary collapse
- #bucket(bucket_name, folder_path = nil) ⇒ Object
- #buckets ⇒ Object
-
#initialize(key, secret, region) ⇒ Client
constructor
A new instance of Client.
- #session ⇒ Object
Constructor Details
#initialize(key, secret, region) ⇒ Client
5 6 7 8 9 10 11 12 |
# File 'lib/takenoko/s3/client.rb', line 5 def initialize(key,secret,region) @config = { provider: 'AWS', aws_access_key_id: key, aws_secret_access_key: secret, region: region } end |
Instance Method Details
#bucket(bucket_name, folder_path = nil) ⇒ Object
22 23 24 |
# File 'lib/takenoko/s3/client.rb', line 22 def bucket(bucket_name,folder_path=nil) session.directories.get(bucket_name, prefix:folder_path ) end |
#buckets ⇒ Object
18 19 20 |
# File 'lib/takenoko/s3/client.rb', line 18 def buckets session.directories end |
#session ⇒ Object
14 15 16 |
# File 'lib/takenoko/s3/client.rb', line 14 def session Fog::Storage.new @config end |