Class: S3FileHandler::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_file_handler/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



7
8
9
# File 'lib/s3_file_handler/configuration.rb', line 7

def initialize
  @force_path_style = false
end

Instance Attribute Details

#access_key_idObject

Returns the value of attribute access_key_id.



5
6
7
# File 'lib/s3_file_handler/configuration.rb', line 5

def access_key_id
  @access_key_id
end

#endpointObject

Returns the value of attribute endpoint.



5
6
7
# File 'lib/s3_file_handler/configuration.rb', line 5

def endpoint
  @endpoint
end

#force_path_styleObject

Returns the value of attribute force_path_style.



5
6
7
# File 'lib/s3_file_handler/configuration.rb', line 5

def force_path_style
  @force_path_style
end

#regionObject

Returns the value of attribute region.



5
6
7
# File 'lib/s3_file_handler/configuration.rb', line 5

def region
  @region
end

#secret_access_keyObject

Returns the value of attribute secret_access_key.



5
6
7
# File 'lib/s3_file_handler/configuration.rb', line 5

def secret_access_key
  @secret_access_key
end

Instance Method Details

#client_optionsObject



11
12
13
14
15
16
17
18
19
20
# File 'lib/s3_file_handler/configuration.rb', line 11

def client_options
  opts = {
    region: region || 'us-east-1',
    access_key_id: access_key_id,
    secret_access_key: secret_access_key
  }
  opts[:endpoint] = endpoint if endpoint
  opts[:force_path_style] = force_path_style if force_path_style
  opts
end