stripe-ruby/lib/stripe/bitcoin_receiver.rb
Brandur aa7e559115 Extend Stripe::APIOperations::Create instead of including
Lets not be too shy about just using `extend` instead of `include` here
when it's more appropriate to do so. The advantage to this approach is
that the module can be either extended _or_ included with this change,
but couldn't be without it due to the `ClassMethods` meta-magic.

List has already started doing this as of #314, so we don't have to be
afraid of breaking convention here.
2015-10-05 12:24:53 -07:00

21 lines
478 B
Ruby

module Stripe
class BitcoinReceiver < APIResource
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Update
include Stripe::APIOperations::Delete
extend Stripe::APIOperations::List
def self.url
"/v1/bitcoin/receivers"
end
def url
if respond_to?(:customer)
"#{Customer.url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}"
else
"#{self.class.url}/#{CGI.escape(id)}"
end
end
end
end