Class: School21::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/school21/auth/access_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token, expires_in) ⇒ AccessToken

Returns a new instance of AccessToken.



7
8
9
10
# File 'lib/school21/auth/access_token.rb', line 7

def initialize(access_token, expires_in)
  @access_token = access_token
  @expires_at = Time.now + expires_in
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



5
6
7
# File 'lib/school21/auth/access_token.rb', line 5

def access_token
  @access_token
end

Instance Method Details

#expired?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/school21/auth/access_token.rb', line 12

def expired?
  Time.now >= @expires_at
end