Class: Strava::Models::SummaryAthlete

Inherits:
Response show all
Defined in:
lib/strava/models/summary_athlete.rb

Overview

Represents summary information about a Strava athlete.

Contains basic profile information about an athlete. This is typically returned when listing kudoers, commenters, or other athletes associated with activities, rather than the full DetailedAthlete information.

Examples:

Access athlete who kudoed an activity

kudoers = client.activity_kudos(1234567890)
kudoers.each do |athlete|
  puts "#{athlete.name} from #{athlete.city}"
  puts athlete.strava_url
end

See Also:

Instance Method Summary collapse

Instance Method Details

#cityString?

Returns City.

Returns:

  • (String, nil)

    City



42
# File 'lib/strava/models/summary_athlete.rb', line 42

property 'city'

#countryString?

Returns Country.

Returns:

  • (String, nil)

    Country



48
# File 'lib/strava/models/summary_athlete.rb', line 48

property 'country'

#created_atTime

Returns When the athlete account was created.

Returns:

  • (Time)

    When the athlete account was created



60
# File 'lib/strava/models/summary_athlete.rb', line 60

property 'created_at', transform_with: ->(v) { Time.parse(v) }

#firstnameString

Returns First name.

Returns:

  • (String)

    First name



30
# File 'lib/strava/models/summary_athlete.rb', line 30

property 'firstname'

#idInteger

Returns Athlete ID.

Returns:

  • (Integer)

    Athlete ID



24
# File 'lib/strava/models/summary_athlete.rb', line 24

property 'id'

#lastnameString

Returns Last name.

Returns:

  • (String)

    Last name



33
# File 'lib/strava/models/summary_athlete.rb', line 33

property 'lastname'

#nameString?

Returns the athlete's full name.

Returns:

  • (String, nil)

    Full name combining firstname and lastname, or nil if neither exists



70
71
72
# File 'lib/strava/models/summary_athlete.rb', line 70

def name
  [firstname, lastname].compact.join(' ') if firstname || lastname
end

#premiumBoolean

Returns Whether the athlete has a premium subscription.

Returns:

  • (Boolean)

    Whether the athlete has a premium subscription



54
# File 'lib/strava/models/summary_athlete.rb', line 54

property 'premium'

#profileString?

Returns URL to full-sized profile picture.

Returns:

  • (String, nil)

    URL to full-sized profile picture



39
# File 'lib/strava/models/summary_athlete.rb', line 39

property 'profile'

#profile_mediumString?

Returns URL to medium-sized profile picture.

Returns:

  • (String, nil)

    URL to medium-sized profile picture



36
# File 'lib/strava/models/summary_athlete.rb', line 36

property 'profile_medium'

#resource_stateInteger

Returns Resource state indicator.

Returns:

  • (Integer)

    Resource state indicator



27
# File 'lib/strava/models/summary_athlete.rb', line 27

property 'resource_state'

#sexString

Returns Sex ('M' for male, 'F' for female).

Returns:

  • (String)

    Sex ('M' for male, 'F' for female)



51
# File 'lib/strava/models/summary_athlete.rb', line 51

property 'sex'

#stateString?

Returns State or province.

Returns:

  • (String, nil)

    State or province



45
# File 'lib/strava/models/summary_athlete.rb', line 45

property 'state'

#strava_urlString

Returns the Strava web URL for this athlete's profile.

Returns:

  • (String)

    Full URL to view the athlete on Strava.com



79
80
81
# File 'lib/strava/models/summary_athlete.rb', line 79

def strava_url
  "https://www.strava.com/athletes/#{id}"
end

#summitBoolean

Returns Whether the athlete has a Summit subscription.

Returns:

  • (Boolean)

    Whether the athlete has a Summit subscription



57
# File 'lib/strava/models/summary_athlete.rb', line 57

property 'summit'

#updated_atTime

Returns When the athlete account was last updated.

Returns:

  • (Time)

    When the athlete account was last updated



63
# File 'lib/strava/models/summary_athlete.rb', line 63

property 'updated_at', transform_with: ->(v) { Time.parse(v) }