Open crazy2be opened 10 years ago
This is unfortunate, but expected behavior.
Airbrite::Order is actually hash, so .count yields the number of items in the hash element.
Confusing, but is what it is.
Ben
On Wed, Nov 13, 2013 at 5:54 PM, crazy2be notifications@github.com wrote:
Using the following code to get all orders:
skip = 0 while true result = Airbrite::Order.list(limit: 1000, skip: skip)
Process the data...
skip = result.paging.offset + result.paging.count break unless result.paging.has_more end
Always returns 5 for result.paging.count. Using result.paging["count"]works as expected.
I suppose this is likely because result.paging is a hash, so it has it's own count property. Might be worth noting in the docs (or just leaving this issue here for people to find).
— Reply to this email directly or view it on GitHubhttps://github.com/pebble/airbrite-ruby/issues/2 .
Using the following code to get all orders:
Always returns
5
forresult.paging.count
. Usingresult.paging["count"]
works as expected.I suppose this is likely because
result.paging
is a hash, so it has it's owncount
property. Might be worth noting in the docs (or just leaving this issue here for people to find).