Class: CloudConvert::File

Inherits:
Faraday::Multipart::FilePart
  • Object
show all
Defined in:
lib/cloudconvert/file.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, content_type = nil, *parts) ⇒ File

Returns a new instance of File.



3
4
5
6
7
# File 'lib/cloudconvert/file.rb', line 3

def initialize(file, content_type = nil, *parts)
  content_type ||= "text/plain" if file.is_a? StringIO
  content_type ||= Marcel::Magic.by_magic(file) || Marcel::Magic.by_path(file)
  super(file, content_type, *parts)
end