Class: School21::AccessToken
- Inherits:
-
Object
- Object
- School21::AccessToken
- Defined in:
- lib/school21/auth/access_token.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
readonly
Returns the value of attribute access_token.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(access_token, expires_in) ⇒ AccessToken
constructor
A new instance of AccessToken.
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_token ⇒ Object (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
12 13 14 |
# File 'lib/school21/auth/access_token.rb', line 12 def expired? Time.now >= @expires_at end |