Sha256: e20ad4064aa980688e9055635a5de662e1b3e85c38742da712ef0ff0be96ccad

Contents?: true

Size: 934 Bytes

Versions: 25

Compression:

Stored size: 934 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

25 entries across 25 versions & 1 rubygems

Version Path
stripe-3.3.2 lib/stripe/api_operations/list.rb
stripe-3.3.1 lib/stripe/api_operations/list.rb
stripe-3.3.0 lib/stripe/api_operations/list.rb
stripe-3.2.0 lib/stripe/api_operations/list.rb
stripe-3.1.0 lib/stripe/api_operations/list.rb
stripe-3.0.3 lib/stripe/api_operations/list.rb
stripe-3.0.1 lib/stripe/api_operations/list.rb
stripe-3.0.0 lib/stripe/api_operations/list.rb
stripe-2.12.0 lib/stripe/api_operations/list.rb
stripe-2.11.0 lib/stripe/api_operations/list.rb
stripe-2.10.0 lib/stripe/api_operations/list.rb
stripe-2.9.0 lib/stripe/api_operations/list.rb
stripe-2.8.0 lib/stripe/api_operations/list.rb
stripe-2.7.0 lib/stripe/api_operations/list.rb
stripe-2.6.0 lib/stripe/api_operations/list.rb
stripe-2.5.0 lib/stripe/api_operations/list.rb
stripe-2.4.0 lib/stripe/api_operations/list.rb
stripe-2.3.0 lib/stripe/api_operations/list.rb
stripe-2.2.1 lib/stripe/api_operations/list.rb
stripe-2.2.0 lib/stripe/api_operations/list.rb