Class: ActiveAws::Configure

Inherits:
Object
  • Object
show all
Defined in:
lib/active_aws/configure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**params) {|_self| ... } ⇒ Configure

Returns a new instance of Configure.

Yields:

  • (_self)

Yield Parameters:



8
9
10
11
12
13
# File 'lib/active_aws/configure.rb', line 8

def initialize( **params )
  params.each do |k,v|
    self.send("#{k}=", v) if self.methods.include?(k)
  end
  yield( self ) if block_given?
end

Instance Attribute Details

#access_keyObject

Returns the value of attribute access_key.



3
4
5
# File 'lib/active_aws/configure.rb', line 3

def access_key
  @access_key
end

#profileObject

Returns the value of attribute profile.



3
4
5
# File 'lib/active_aws/configure.rb', line 3

def profile
  @profile
end

#regionObject

Returns the value of attribute region.



3
4
5
# File 'lib/active_aws/configure.rb', line 3

def region
  @region
end

#secret_keyObject

Returns the value of attribute secret_key.



3
4
5
# File 'lib/active_aws/configure.rb', line 3

def secret_key
  @secret_key
end

Instance Method Details

#credentialsObject



15
16
17
18
19
20
# File 'lib/active_aws/configure.rb', line 15

def credentials
  @credentials ||= profile ?
    Aws::SharedCredentials.new( profile_name: profile ) :
    Aws::Credentials.new( access_key, secret_key )
  @credentials
end

#default_client_paramsObject



22
23
24
25
26
27
# File 'lib/active_aws/configure.rb', line 22

def default_client_params
  {
    region: region,
    credentials: credentials,
  }
end