Class: ActiveAws::Configure
- Inherits:
-
Object
- Object
- ActiveAws::Configure
- Defined in:
- lib/active_aws/configure.rb
Instance Attribute Summary collapse
-
#access_key ⇒ Object
Returns the value of attribute access_key.
-
#profile ⇒ Object
Returns the value of attribute profile.
-
#region ⇒ Object
Returns the value of attribute region.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
Instance Method Summary collapse
- #credentials ⇒ Object
- #default_client_params ⇒ Object
-
#initialize(**params) {|_self| ... } ⇒ Configure
constructor
A new instance of Configure.
Constructor Details
#initialize(**params) {|_self| ... } ⇒ Configure
Returns a new instance of Configure.
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_key ⇒ Object
Returns the value of attribute access_key.
3 4 5 |
# File 'lib/active_aws/configure.rb', line 3 def access_key @access_key end |
#profile ⇒ Object
Returns the value of attribute profile.
3 4 5 |
# File 'lib/active_aws/configure.rb', line 3 def profile @profile end |
#region ⇒ Object
Returns the value of attribute region.
3 4 5 |
# File 'lib/active_aws/configure.rb', line 3 def region @region end |
#secret_key ⇒ Object
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
#credentials ⇒ Object
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_params ⇒ Object
22 23 24 25 26 27 |
# File 'lib/active_aws/configure.rb', line 22 def default_client_params { region: region, credentials: credentials, } end |