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

repos.pull_request.all Returns Variable Length Array Depending on if There Are More Pages #89

Open
sshaw opened this issue Jul 23, 2017 · 2 comments

Comments

@sshaw
Copy link

sshaw commented Jul 23, 2017

The result set is in values, right? Its contents vary depending on if there's another page:

cl.repos.pull_request.all("some", "repo").values.size # 4 if last page, 5 if not
cl.repos.pull_request.all("some", "repo").values[1]    # result set if last page, next URL if not
@sshaw
Copy link
Author

sshaw commented Jul 23, 2017

Sometimes it's

[10, 38, #<Hashie::Array ...>, 1, "https://bitbucket.org/api/2.0/repositories/tortoisehg/thg/pullrequests?state=merged&page=2"]

And other times:

["https://bitbucket.org/api/2.0/repositories/tortoisehg/thg/pullrequests?state=merged&page=3", #<Hashie::Array ...>, 10, 38, 2, "https://bitbucket.org/api/2.0/repositories/tortoisehg/thg/pullrequests?state=merged&page=1"]

🙀 😱 :rage4:

@sshaw
Copy link
Author

sshaw commented Jul 23, 2017

Wait, so it works if I do

cl.repos.pull_request.all("some", "repo")["values"] 

Ugh.

🚁

⬇️

Hashie

⬇️

⬇️

⬇️

🗑️

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

No branches or pull requests

1 participant