Add some documentation on ordering direction

This commit is contained in:
Brandur 2019-10-10 10:36:32 -07:00
parent 15f8304e48
commit 00b60afbf5

View File

@ -51,6 +51,16 @@ module Stripe
# Iterates through each resource in all pages, making additional fetches to
# the API as necessary.
#
# The default iteration direction is forwards according to Stripe's API
# "natural" ordering direction -- newer objects first, and moving towards
# older objects.
#
# However, if the initial list object was fetched using an `ending_before`
# cursor (and only `ending_before`, `starting_after` cannot also be
# included), the method assumes that the user is trying to iterate
# backwards compared to natural ordering and returns results that way --
# older objects first, and moving towards newer objects.
#
# Note that this method will make as many API calls as necessary to fetch
# all resources. For more granular control, please see +each+ and
# +next_page+.