Class: FriendlyShipping::Services::UpsJson::AccessToken
- Inherits:
-
Object
- Object
- FriendlyShipping::Services::UpsJson::AccessToken
- 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
-
#expires_in ⇒ Integer
readonly
The token's expiration.
-
#issued_at ⇒ Integer
readonly
The epoch time in ms when the token was issued.
-
#raw_token ⇒ String
readonly
The raw JWT token.
Instance Method Summary collapse
-
#initialize(expires_in:, issued_at:, raw_token:) ⇒ AccessToken
constructor
A new instance of AccessToken.
Constructor Details
#initialize(expires_in:, issued_at:, raw_token:) ⇒ AccessToken
Returns a new instance of AccessToken.
21 22 23 24 25 |
# File 'lib/friendly_shipping/services/ups_json/access_token.rb', line 21 def initialize(expires_in:, issued_at:, raw_token:) @expires_in = expires_in @issued_at = issued_at @raw_token = raw_token end |
Instance Attribute Details
#expires_in ⇒ Integer (readonly)
Returns the token's expiration.
10 11 12 |
# File 'lib/friendly_shipping/services/ups_json/access_token.rb', line 10 def expires_in @expires_in end |
#issued_at ⇒ Integer (readonly)
Returns the epoch time in ms when the token was issued.
13 14 15 |
# File 'lib/friendly_shipping/services/ups_json/access_token.rb', line 13 def issued_at @issued_at end |
#raw_token ⇒ String (readonly)
Returns the raw JWT token.
16 17 18 |
# File 'lib/friendly_shipping/services/ups_json/access_token.rb', line 16 def raw_token @raw_token end |