Class: Strava::Models::Token
- Inherits:
-
Response
- Object
- Hashie::Trash
- Strava::Model
- Response
- Strava::Models::Token
- Defined in:
- lib/strava/models/token.rb
Overview
Represents an OAuth token response from Strava.
This model is returned when exchanging an authorization code for an access token or when refreshing an expired token. It contains the access token, refresh token, expiration time, and basic athlete information.
Tokens expire after a period of time (typically 6 hours). When a token expires, use the refresh_token to obtain a new access_token via the OAuth flow.
Instance Method Summary collapse
-
#access_token ⇒ String
OAuth access token for API authentication.
-
#athlete ⇒ Strava::Models::SummaryAthlete
Summary of the authenticated athlete.
-
#expires_at ⇒ Time
Expiration time of the access token.
-
#expires_in ⇒ Integer
Number of seconds until token expires.
-
#refresh_token ⇒ String
Refresh token for obtaining new access tokens.
-
#token_type ⇒ String
Type of token, typically "Bearer".
Instance Method Details
#access_token ⇒ String
Returns OAuth access token for API authentication.
30 |
# File 'lib/strava/models/token.rb', line 30 property 'access_token' |
#athlete ⇒ Strava::Models::SummaryAthlete
Returns Summary of the authenticated athlete.
42 |
# File 'lib/strava/models/token.rb', line 42 property 'athlete', transform_with: ->(v) { Strava::Models::SummaryAthlete.new(v) } |
#expires_at ⇒ Time
Returns Expiration time of the access token.
39 |
# File 'lib/strava/models/token.rb', line 39 property 'expires_at', transform_with: ->(v) { Time.at(v) } |
#expires_in ⇒ Integer
Returns Number of seconds until token expires.
36 |
# File 'lib/strava/models/token.rb', line 36 property 'expires_in' |
#refresh_token ⇒ String
Returns Refresh token for obtaining new access tokens.
33 |
# File 'lib/strava/models/token.rb', line 33 property 'refresh_token' |
#token_type ⇒ String
Returns Type of token, typically "Bearer".
27 |
# File 'lib/strava/models/token.rb', line 27 property 'token_type' |