Class: Swa::IAM::Credentials
- Inherits:
-
Object
- Object
- Swa::IAM::Credentials
- Defined in:
- lib/swa/iam/credentials.rb
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
-
#session_token ⇒ Object
Returns the value of attribute session_token.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Credentials
constructor
A new instance of Credentials.
- #to_env ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Credentials
Returns a new instance of Credentials.
6 7 8 9 10 |
# File 'lib/swa/iam/credentials.rb', line 6 def initialize(attributes = {}) attributes.to_h.each do |k,v| send("#{k}=", v) end end |
Instance Attribute Details
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
12 13 14 |
# File 'lib/swa/iam/credentials.rb', line 12 def access_key_id @access_key_id end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
16 17 18 |
# File 'lib/swa/iam/credentials.rb', line 16 def expires_at @expires_at end |
#secret_access_key ⇒ Object
Returns the value of attribute secret_access_key.
13 14 15 |
# File 'lib/swa/iam/credentials.rb', line 13 def secret_access_key @secret_access_key end |
#session_token ⇒ Object
Returns the value of attribute session_token.
14 15 16 |
# File 'lib/swa/iam/credentials.rb', line 14 def session_token @session_token end |
Instance Method Details
#to_env ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/swa/iam/credentials.rb', line 19 def to_env { "AWS_ACCESS_KEY_ID" => access_key_id, "AWS_SECRET_ACCESS_KEY" => secret_access_key, "AWS_SESSION_TOKEN" => session_token, "AWS_SESSION_EXPIRES" => expires_at.iso8601 } end |