Class: TimeTree::CalendarApp::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/timetree/calendar_app/access_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atInteger (readonly)

Returns:

  • (Integer)


9
10
11
# File 'lib/timetree/calendar_app/access_token.rb', line 9

def expire_at
  @expire_at
end

#tokenString (readonly)

Returns:

  • (String)


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.

Returns:

  • (Boolean)


20
21
22
# File 'lib/timetree/calendar_app/access_token.rb', line 20

def expired?
  Time.now.to_i > expire_at
end