Class: S3::Service

Inherits:
Object
  • Object
show all
Includes:
BucketMethods, MultipartMethods, ObjectMethods, PresignMethods
Defined in:
lib/s3/service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PresignMethods

#presign_get, #presign_put

Methods included from MultipartMethods

#multipart_abort, #multipart_complete, #multipart_create, #multipart_list, #multipart_parts, #multipart_upload

Methods included from ObjectMethods

#object_copy, #object_delete, #object_delete_batch, #object_exists?, #object_get, #object_head, #object_list, #object_metadata_set, #object_put

Methods included from BucketMethods

#bucket_create, #bucket_delete, #bucket_exists?, #bucket_head, #bucket_list

Constructor Details

#initialize(access_key_id:, secret_access_key:, region: 'us-east-1', endpoint: nil, connection: nil, connection_pool: nil, open_timeout: 10, timeout: 300) ⇒ Service

Returns a new instance of Service.

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/s3/service.rb', line 10

def initialize( access_key_id:, secret_access_key:,
                region: 'us-east-1', endpoint: nil,
                connection: nil, connection_pool: nil,
                open_timeout: 10, timeout: 300 )

  raise ArgumentError, 'access_key_id is required' if access_key_id.nil? || access_key_id.empty?
  raise ArgumentError, 'secret_access_key is required' if secret_access_key.nil? || secret_access_key.empty?

  @access_key_id = access_key_id
  @secret_access_key = secret_access_key
  @region = region
  @endpoint = endpoint
  @connection_pool = connection_pool
  @open_timeout = open_timeout
  @timeout = timeout
  @connection = connection || build_connection
end

Instance Attribute Details

#access_key_id ⇒ Object (readonly)

Returns the value of attribute access_key_id.



8
9
10
# File 'lib/s3/service.rb', line 8

def access_key_id
  @access_key_id
end

#endpoint ⇒ Object (readonly)

Returns the value of attribute endpoint.



8
9
10
# File 'lib/s3/service.rb', line 8

def endpoint
  @endpoint
end

#region ⇒ Object (readonly)

Returns the value of attribute region.



8
9
10
# File 'lib/s3/service.rb', line 8

def region
  @region
end