Class: PetfinderV2::Serializers::AccessToken
- Inherits:
-
Object
- Object
- PetfinderV2::Serializers::AccessToken
- Defined in:
- lib/petfinder_V2/serializers/access_token.rb
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(data) ⇒ AccessToken
constructor
A new instance of AccessToken.
Constructor Details
#initialize(data) ⇒ AccessToken
Returns a new instance of AccessToken.
5 6 7 8 |
# File 'lib/petfinder_V2/serializers/access_token.rb', line 5 def initialize(data) @token = data['access_token'] @expires_at = Time.now + data['expires_in'].to_i end |
Instance Attribute Details
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
4 5 6 |
# File 'lib/petfinder_V2/serializers/access_token.rb', line 4 def expires_at @expires_at end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/petfinder_V2/serializers/access_token.rb', line 4 def token @token end |