You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
*[#94](https://github.com/dblock/strava-ruby-client/pull/94): Adds video fields to `Strava::Models::Photo` - [@dblock](https://github.com/dblock).
5
5
*[#92](https://github.com/dblock/strava-ruby-client/pull/92): Fixes `Hashie::Trash` serialization warning for `object_id` of `Strava::Webhooks::Models::Event` - [@simonneutert](https://github.com/simonneutert).
6
6
*[#95](https://github.com/dblock/strava-ruby-client/pull/95): Fixed `club_events` returning `Strava::Models::ClubEvent` with an empty string in `created_at` - [@dblock](https://github.com/dblock).
7
+
*[#99](https://github.com/dblock/strava-ruby-client/pull/99): Added support for `page_size` on `activity_comments` and added `limit` - [@dblock](https://github.com/dblock).
Copy file name to clipboardExpand all lines: README.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -776,14 +776,32 @@ See [Strava::Errors::UploadError](lib/strava/errors/upload_failed_error.rb) for
776
776
777
777
### Pagination
778
778
779
-
Some Strava APIs, including [athlete-activities](#list-athlete-activities) support pagination when supplying an optional `page` and `per_page` parameter. By default the client retrieves one page of data, which Strava currently defaults to 30 items. You can paginate through more data by supplying a block and an optional `per_page` parameter. The underlying implementation makes page-sized calls and increments the `page` argument.
779
+
Some Strava APIs, including [athlete-activities](#list-athlete-activities) support pagination when supplying an optional `page` and `per_page` parameter. By default the client retrieves one page of data, which Strava currently defaults to 30 items. If you supply `per_page`, the client will retrieve all pages. Use `limit` to limit the number of items returned. The underlying implementation makes page-sized calls and increments the `page` argument.
780
780
781
781
```ruby
782
782
client.athlete_activities(per_page:30) do |activity|
783
783
activity # => Strava::Models::Activity
784
784
end
785
785
```
786
786
787
+
```ruby
788
+
client.athlete_activities(per_page:30) # => [Strava::Models::Activity], all pages
789
+
client.athlete_activities(per_page:30, limit:50) # => [Strava::Models::Activity], all pages, stop at 50 items
790
+
```
791
+
792
+
Some Strava APIs, including [activity-comments](#list-activity-comments) support cursor-based pagination when supplying optional `after_cursor` and `page_size` parameters. By default the client retrieves one page of data, which Strava currently defaults to 30 items. You can paginate through more data by supplying a block and an optional `page_size`. Use `limit` to limit the number of items returned. The underlying implementation makes page-sized calls and uses the returned `cursor` as `after_cursor`.
793
+
794
+
```ruby
795
+
client.activity_comments(id:1982980795, page_size:30) do |comment|
796
+
comment # => Strava::Models::Comment
797
+
end
798
+
```
799
+
800
+
```ruby
801
+
client.activity_comments(id:1982980795, page_size:30) # => [Strava::Models::Comment], all pages
See [#99](https://github.com/dblock/strava-ruby-client/pull/99) for details.
107
+
83
108
### Upgrading to >= 2.3.0
84
109
85
110
Faraday can optionally exclude HTTP method, path and query params from the errors raised. The client implementation options will now default to `Faraday::Response::RaiseError::DEFAULT_OPTIONS` with `include_request` set to `true`. You can change this behavior by setting `Strava::Web::RaiseResponseError::DEFAULT_OPTIONS`.
0 commit comments