Class: FriendlyShipping::Services::UpsJson::AccessToken

Inherits:
AccessToken
  • Object
show all
Defined in:
lib/friendly_shipping/services/ups_json/access_token.rb

Overview

Represents an access token returned by UPS. The access token can be used to make API requests. Once it expires, a new token must be created.

Instance Attribute Summary collapse

Attributes inherited from AccessToken

#expires_in, #raw_token

Instance Method Summary collapse

Methods inherited from AccessToken

#decoded_token

Constructor Details

#initialize(issued_at:, **other_kwargs) ⇒ AccessToken

Returns a new instance of AccessToken.

Parameters:

  • issued_at (Integer)

    the time the token was issued at



13
14
15
16
# File 'lib/friendly_shipping/services/ups_json/access_token.rb', line 13

def initialize(issued_at:, **other_kwargs)
  @issued_at = issued_at
  super(**other_kwargs)
end

Instance Attribute Details

#issued_atInteger (readonly)

Returns the epoch time in ms when the token was issued.

Returns:

  • (Integer)

    the epoch time in ms when the token was issued



10
11
12
# File 'lib/friendly_shipping/services/ups_json/access_token.rb', line 10

def issued_at
  @issued_at
end