Brandur 3433130c5d
Rename API resource's request method (#936)
As seen in #928, the `refresh` method doesn't work for an event class.
This is because event has a field called `request`, and it ends up
replacing the `request` method that it inherited from being an API
resource, so when `refresh` tries to make a request, it fails because it
tries to invoke it on the accessor added for the event's property.

Here we give `request` a much more unique name so that it will never
conflict with a property field again, and update all internal references
to use the new name. We use `alias` to make the old name available for
backwards compatibility reasons because its been around for so long that
people are probably calling it.

Fixes #928.
2020-08-05 16:00:37 -07:00

20 lines
518 B
Ruby

# frozen_string_literal: true
module Stripe
module APIOperations
module List
def list(filters = {}, opts = {})
opts = Util.normalize_opts(opts)
resp, opts = execute_resource_request(:get, resource_url, filters, opts)
obj = ListObject.construct_from(resp.data, opts)
# set filters so that we can fetch the same limit, expansions, and
# predicates when accessing the next and previous pages
obj.filters = filters.dup
obj
end
end
end
end