Sha256: b153ff65da93a3c9bcf969143cc6e8c1df41ade4792b130f1c64897d4549d9ba
Contents?: true
Size: 967 Bytes
Versions: 9
Compression:
Stored size: 967 Bytes
Contents
module Stripe class ListObject < StripeObject include Stripe::APIOperations::Request def [](k) case k when String, Symbol super else raise ArgumentError.new("You tried to access the #{k.inspect} index, but ListObject types only support String keys. (HINT: List calls return an object with a 'data' (which is the data array). You likely want to call #data[#{k.inspect}])") end end def each(&blk) self.data.each(&blk) end def retrieve(id, opts={}) response, opts = request(:get,"#{url}/#{CGI.escape(id)}", {}, opts) Util.convert_to_stripe_object(response, opts) end def create(params={}, opts={}) response, opts = request(:post, url, params, opts) Util.convert_to_stripe_object(response, opts) end def all(params={}, opts={}) response, opts = request(:get, url, params, opts) Util.convert_to_stripe_object(response, opts) end end end
Version data entries
9 entries across 9 versions & 1 rubygems