Sha256: a537656d885eeeba4b24fa4d2597133c04f5101e0a02ff80941b16f11bbc36c9

Contents?: true

Size: 936 Bytes

Versions: 20

Compression:

Stored size: 936 Bytes

Contents

module Stripe
  module APIOperations
    module List
      def list(filters = {}, opts = {})
        opts = Util.normalize_opts(opts)

        resp, opts = 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
        #
        # just for general cleanliness, remove any paging options
        obj.filters = filters.dup
        obj.filters.delete(:ending_before)
        obj.filters.delete(:starting_after)

        obj
      end

      # The original version of #list was given the somewhat unfortunate name of
      # #all, and this alias allows us to maintain backward compatibility (the
      # choice was somewhat misleading in the way that it only returned a single
      # page rather than all objects).
      alias all list
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
stripe-3.14.0 lib/stripe/api_operations/list.rb
stripe-3.13.1 lib/stripe/api_operations/list.rb
stripe-3.13.0 lib/stripe/api_operations/list.rb
stripe-3.12.1 lib/stripe/api_operations/list.rb
stripe-3.12.0 lib/stripe/api_operations/list.rb
stripe-3.11.0 lib/stripe/api_operations/list.rb
stripe-3.10.0 lib/stripe/api_operations/list.rb
stripe-3.9.2 lib/stripe/api_operations/list.rb
stripe-3.9.1 lib/stripe/api_operations/list.rb
stripe-3.9.0 lib/stripe/api_operations/list.rb
stripe-3.8.2 lib/stripe/api_operations/list.rb
stripe-3.8.1 lib/stripe/api_operations/list.rb
stripe-3.8.0 lib/stripe/api_operations/list.rb
stripe-3.7.0 lib/stripe/api_operations/list.rb
stripe-3.6.0 lib/stripe/api_operations/list.rb
stripe-3.5.3 lib/stripe/api_operations/list.rb
stripe-3.5.2 lib/stripe/api_operations/list.rb
stripe-3.5.1 lib/stripe/api_operations/list.rb
stripe-3.5.0 lib/stripe/api_operations/list.rb
stripe-3.4.1 lib/stripe/api_operations/list.rb