Class: PetfinderV2::Serializers::AccessToken

Inherits:
Object
  • Object
show all
Defined in:
lib/petfinder_V2/serializers/access_token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject (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

#tokenObject (readonly)

Returns the value of attribute token.



4
5
6
# File 'lib/petfinder_V2/serializers/access_token.rb', line 4

def token
  @token
end