mirror of
https://github.com/stripe/stripe-ruby.git
synced 2025-10-08 00:02:46 -04:00
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.
25 lines
519 B
Ruby
25 lines
519 B
Ruby
module Stripe
|
|
class FileUpload < APIResource
|
|
extend Stripe::APIOperations::Create
|
|
extend Stripe::APIOperations::List
|
|
|
|
def self.url
|
|
"/v1/files"
|
|
end
|
|
|
|
def self.request(method, url, params={}, opts={})
|
|
opts = {
|
|
:api_base => Stripe::uploads_base
|
|
}.merge(Util.normalize_opts(opts))
|
|
super
|
|
end
|
|
|
|
def self.create(params={}, opts={})
|
|
opts = {
|
|
:content_type => 'multipart/form-data',
|
|
}.merge(Util.normalize_opts(opts))
|
|
super
|
|
end
|
|
end
|
|
end
|