Class: BigShift::AccessToken
- Inherits:
-
Object
- Object
- BigShift::AccessToken
- Defined in:
- lib/big_shift/models/access_token.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#expires ⇒ Object
Returns the value of attribute expires.
Instance Method Summary collapse
- #expired? ⇒ Boolean
-
#initialize(hash = {}) ⇒ AccessToken
constructor
A new instance of AccessToken.
Constructor Details
#initialize(hash = {}) ⇒ AccessToken
Returns a new instance of AccessToken.
5 6 7 8 9 |
# File 'lib/big_shift/models/access_token.rb', line 5 def initialize(hash = {}) @access_token = hash['access_token'] @expires = hash['expires_in'] @created = Time.now end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
3 4 5 |
# File 'lib/big_shift/models/access_token.rb', line 3 def access_token @access_token end |
#expires ⇒ Object
Returns the value of attribute expires.
3 4 5 |
# File 'lib/big_shift/models/access_token.rb', line 3 def expires @expires end |
Instance Method Details
#expired? ⇒ Boolean
11 12 13 |
# File 'lib/big_shift/models/access_token.rb', line 11 def expired? Time.now - @created > (expires - 10) end |