Class: FriendlyShipping::Services::USPSShip::AccessToken

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

Overview

Represents an access token returned by USPS Ship. 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(token_type:, **other_kwargs) ⇒ AccessToken

Returns a new instance of AccessToken.

Parameters:

  • token_type (String)

    the token's type (typically "Bearer")



15
16
17
18
# File 'lib/friendly_shipping/services/usps_ship/access_token.rb', line 15

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

Instance Attribute Details

#token_typeString (readonly)

Returns the token's type.

Returns:

  • (String)

    the token's type



12
13
14
# File 'lib/friendly_shipping/services/usps_ship/access_token.rb', line 12

def token_type
  @token_type
end