Class: LeanMicrosoftGraph::Resources::TokenResource::Token
- Inherits:
-
Object
- Object
- LeanMicrosoftGraph::Resources::TokenResource::Token
- Defined in:
- lib/lean_microsoft_graph/resources/token_resource/token.rb
Instance Attribute Summary collapse
-
#expires_in ⇒ Object
readonly
Returns the value of attribute expires_in.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #expired? ⇒ Boolean
- #expires_at ⇒ Object
-
#initialize(value, expires_in) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(value, expires_in) ⇒ Token
Returns a new instance of Token.
9 10 11 12 13 |
# File 'lib/lean_microsoft_graph/resources/token_resource/token.rb', line 9 def initialize(value, expires_in) @value = value @expires_in = expires_in @created_at = Time.now end |
Instance Attribute Details
#expires_in ⇒ Object (readonly)
Returns the value of attribute expires_in.
7 8 9 |
# File 'lib/lean_microsoft_graph/resources/token_resource/token.rb', line 7 def expires_in @expires_in end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/lean_microsoft_graph/resources/token_resource/token.rb', line 7 def value @value end |
Instance Method Details
#expired? ⇒ Boolean
19 20 21 |
# File 'lib/lean_microsoft_graph/resources/token_resource/token.rb', line 19 def expired? Time.now > expires_at end |
#expires_at ⇒ Object
15 16 17 |
# File 'lib/lean_microsoft_graph/resources/token_resource/token.rb', line 15 def expires_at @created_at + @expires_in end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/lean_microsoft_graph/resources/token_resource/token.rb', line 23 def to_s @value end |