Class: TimeTree::CalendarApp::AccessToken
- Inherits:
-
Object
- Object
- TimeTree::CalendarApp::AccessToken
- Defined in:
- lib/timetree/calendar_app/access_token.rb
Instance Attribute Summary collapse
- #expire_at ⇒ Integer readonly
- #token ⇒ String readonly
Instance Method Summary collapse
-
#expired? ⇒ Boolean
Returns the access token is expired or not.
-
#initialize(token, expire_at) ⇒ AccessToken
constructor
A new instance of AccessToken.
Constructor Details
#initialize(token, expire_at) ⇒ AccessToken
Returns a new instance of AccessToken.
11 12 13 14 |
# File 'lib/timetree/calendar_app/access_token.rb', line 11 def initialize(token, expire_at) @token = token @expire_at = expire_at end |
Instance Attribute Details
#expire_at ⇒ Integer (readonly)
9 10 11 |
# File 'lib/timetree/calendar_app/access_token.rb', line 9 def expire_at @expire_at end |
#token ⇒ String (readonly)
7 8 9 |
# File 'lib/timetree/calendar_app/access_token.rb', line 7 def token @token end |
Instance Method Details
#expired? ⇒ Boolean
Returns the access token is expired or not.
20 21 22 |
# File 'lib/timetree/calendar_app/access_token.rb', line 20 def expired? Time.now.to_i > expire_at end |