Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for cursor pagination, closes #157. #161

Merged
merged 1 commit into from
Aug 31, 2017

Conversation

dblock
Copy link
Collaborator

@dblock dblock commented Aug 29, 2017

Using the same methods you can do:

members = []
client.users_list(presence: true, limit: 5) do |json|
  expect(json.ok).to be true
  members.concat json.members
end

which translates to the following in methods that support cursor

Pagination::Cursor.new(self, :users_list, options).each do |page|
  yield page
end

@dblock
Copy link
Collaborator Author

dblock commented Aug 29, 2017

@alexagranov Would love a PR and merge/comments, please!

@dblock dblock changed the title Added support for cursor pagination, closes #157. WIP: Added support for cursor pagination, closes #157. Aug 29, 2017
@dblock dblock changed the title WIP: Added support for cursor pagination, closes #157. Added support for cursor pagination, closes #157. Aug 29, 2017
@dblock
Copy link
Collaborator Author

dblock commented Aug 31, 2017

I'll just merge it, feel free to add comments later @alexagranov ;)

@dblock dblock merged commit 3fbcebf into slack-ruby:master Aug 31, 2017
@alexagranov
Copy link
Contributor

Sorry @dblock, totally missed this. Looks great!

Next time try tagging me as a Reviewer?

@dblock
Copy link
Collaborator Author

dblock commented Aug 31, 2017

Will do, I was mostly just being impatient.

@dblock dblock deleted the pagination branch January 22, 2018 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants