Class: Alula::TokenExchange::ImpersonatedToken
- Inherits:
-
Object
- Object
- Alula::TokenExchange::ImpersonatedToken
- Defined in:
- lib/alula/resources/token_exchange.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Simple Oauth::Response reader object.
-
#date_created ⇒ Object
readonly
Simple Oauth::Response reader object.
-
#expires_at ⇒ Object
readonly
Simple Oauth::Response reader object.
-
#expires_in ⇒ Object
readonly
Simple Oauth::Response reader object.
-
#impersonated_by ⇒ Object
readonly
Simple Oauth::Response reader object.
-
#refresh_token ⇒ Object
readonly
Simple Oauth::Response reader object.
-
#scope ⇒ Object
readonly
Simple Oauth::Response reader object.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ImpersonatedToken
constructor
A new instance of ImpersonatedToken.
Constructor Details
#initialize(attributes) ⇒ ImpersonatedToken
Returns a new instance of ImpersonatedToken.
70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/alula/resources/token_exchange.rb', line 70 def initialize(attributes) @raw_response = attributes @date_created = Time.parse(attributes['dateCreated']) @access_token = attributes['accessToken'] @expires_at = Time.parse(attributes['expires']) @expires_in = (@expires_at - Time.now.utc).to_i @refresh_token = attributes['refresh_token'] @scope = attributes['scope'] @impersonated_by = attributes['impersonatedBy'] end |
Instance Attribute Details
#access_token ⇒ Object (readonly)
Simple Oauth::Response reader object
68 69 70 |
# File 'lib/alula/resources/token_exchange.rb', line 68 def access_token @access_token end |
#date_created ⇒ Object (readonly)
Simple Oauth::Response reader object
68 69 70 |
# File 'lib/alula/resources/token_exchange.rb', line 68 def date_created @date_created end |
#expires_at ⇒ Object (readonly)
Simple Oauth::Response reader object
68 69 70 |
# File 'lib/alula/resources/token_exchange.rb', line 68 def expires_at @expires_at end |
#expires_in ⇒ Object (readonly)
Simple Oauth::Response reader object
68 69 70 |
# File 'lib/alula/resources/token_exchange.rb', line 68 def expires_in @expires_in end |
#impersonated_by ⇒ Object (readonly)
Simple Oauth::Response reader object
68 69 70 |
# File 'lib/alula/resources/token_exchange.rb', line 68 def impersonated_by @impersonated_by end |
#refresh_token ⇒ Object (readonly)
Simple Oauth::Response reader object
68 69 70 |
# File 'lib/alula/resources/token_exchange.rb', line 68 def refresh_token @refresh_token end |
#scope ⇒ Object (readonly)
Simple Oauth::Response reader object
68 69 70 |
# File 'lib/alula/resources/token_exchange.rb', line 68 def scope @scope end |