class Strava::Photo
Strava
allows for attaching photos to activities. These photos can come from either Instagram or be uploaded directly to Strava
. Initially, only Instagram was supported. Later, Strava
began storing photos on its own.
Example:
ca = Strava::Athlete.current_athlete activity = ca.activities.detect{ |a| a.total_photo_count > 0 } # Find activity with any photos, Strava or Instagram. activity = ca.activities.detect{ |a| a.photo_count > 0 } # Check for Instagram photos only activity.photos # Array of `Photo` objects
@see strava.github.io/api/v3/activity_photos/ Strava
Docs - Activity
Photos
Public Instance Methods
update(data, **opts)
click to toggle source
Updates photo with passed data attributes.
@private @param data [Hash] data hash containing photo data @return [self]
# File lib/strava/photo.rb, line 20 def update(data, **opts) @resource_state = data['resource_state'] @activity_id = data['activity_id'] @ref = data["ref"] @uid = data["uid"] @caption = data["caption"] @type = data["type"] @uploaded_at = data["uploaded_at"] @created_at = data["created_at"] @location = data["location"] end