class Vox::HTTP::UploadIO

Wrapper to faraday's UploadIO that allows for an optional MIME type

Public Class Methods

new(file, mime_type = nil, name = nil) click to toggle source

@param file [File, IO, String] A File, IO, or file path for the upload. @param mime_type [String] The MIME type for the file, if `nil` it will be

inferred from the file path, defaulting to 'application/octet-stream'
if no matching MIME type matches.

@param name [String] File name, this can be omitted if the provided file

responds to `path`.
Calls superclass method
# File lib/vox/http/upload_io.rb, line 17
def initialize(file, mime_type = nil, name = nil)
  mime_type ||= mime_for_file(file.respond_to?(:path) ? file.path : file)
  super(file, mime_type, name)
end