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.
-
#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 |
# 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'] 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 |
#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 |