Sha256: 68df855431e1cecea3a954de2fc4c88d1cccd26291816392b79a88d7f9733f29

Contents?: true

Size: 970 Bytes

Versions: 13

Compression:

Stored size: 970 Bytes

Contents

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

        response, opts = request(:get, url, filters, opts)
        obj = ListObject.construct_from(response, 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

13 entries across 13 versions & 1 rubygems

Version Path
stripe-1.36.1 lib/stripe/api_operations/list.rb
stripe-1.36.0 lib/stripe/api_operations/list.rb
stripe-1.35.1 lib/stripe/api_operations/list.rb
stripe-1.35.0 lib/stripe/api_operations/list.rb
stripe-1.34.0 lib/stripe/api_operations/list.rb
stripe-1.33.1 lib/stripe/api_operations/list.rb
stripe-1.33.0 lib/stripe/api_operations/list.rb
stripe-1.32.1 lib/stripe/api_operations/list.rb
stripe-1.32.0 lib/stripe/api_operations/list.rb
stripe-1.31.0 lib/stripe/api_operations/list.rb
stripe-1.30.3 lib/stripe/api_operations/list.rb
stripe-1.30.2 lib/stripe/api_operations/list.rb
stripe-1.30.1 lib/stripe/api_operations/list.rb