Class: SmilyCli::OAuth::Token
- Inherits:
-
Struct
- Object
- Struct
- SmilyCli::OAuth::Token
- Defined in:
- lib/smily_cli/oauth.rb
Overview
Structured token response.
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#expires_in ⇒ Object
Returns the value of attribute expires_in.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
Instance Method Summary collapse
-
#expires_at ⇒ Time?
Absolute expiry, when derivable.
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token
18 19 20 |
# File 'lib/smily_cli/oauth.rb', line 18 def access_token @access_token end |
#created_at ⇒ Object
Returns the value of attribute created_at
18 19 20 |
# File 'lib/smily_cli/oauth.rb', line 18 def created_at @created_at end |
#expires_in ⇒ Object
Returns the value of attribute expires_in
18 19 20 |
# File 'lib/smily_cli/oauth.rb', line 18 def expires_in @expires_in end |
#raw ⇒ Object
Returns the value of attribute raw
18 19 20 |
# File 'lib/smily_cli/oauth.rb', line 18 def raw @raw end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token
18 19 20 |
# File 'lib/smily_cli/oauth.rb', line 18 def refresh_token @refresh_token end |
#scope ⇒ Object
Returns the value of attribute scope
18 19 20 |
# File 'lib/smily_cli/oauth.rb', line 18 def scope @scope end |
#token_type ⇒ Object
Returns the value of attribute token_type
18 19 20 |
# File 'lib/smily_cli/oauth.rb', line 18 def token_type @token_type end |
Instance Method Details
#expires_at ⇒ Time?
Returns absolute expiry, when derivable.
23 24 25 26 27 |
# File 'lib/smily_cli/oauth.rb', line 23 def expires_at return nil unless created_at && expires_in Time.at(created_at.to_i + expires_in.to_i) end |