Sha256: 88ea7b1227780d8e0dbe08d96ff16238e8abde41be0817d04a611032c2636121
Contents?: true
Size: 987 Bytes
Versions: 10
Compression:
Stored size: 987 Bytes
Contents
# File generated from our OpenAPI spec # frozen_string_literal: true module Stripe class File < APIResource extend Stripe::APIOperations::Create extend Stripe::APIOperations::List OBJECT_NAME = "file" # This resource can have two different object names. In latter API # versions, only `file` is used, but since stripe-ruby may be used with # any API version, we need to support deserializing the older # `file_upload` object into the same class. OBJECT_NAME_ALT = "file_upload" def self.resource_url "/v1/files" end def self.create(params = {}, opts = {}) if params[:file] && !params[:file].is_a?(String) unless params[:file].respond_to?(:read) raise ArgumentError, "file must respond to `#read`" end end opts = { api_base: Stripe.uploads_base, content_type: MultipartEncoder::MULTIPART_FORM_DATA, }.merge(Util.normalize_opts(opts)) super end end end
Version data entries
10 entries across 10 versions & 1 rubygems