Class: Locomotive::Coal::UploadIO
- Inherits:
-
Faraday::UploadIO
- Object
- Faraday::UploadIO
- Locomotive::Coal::UploadIO
- Defined in:
- lib/locomotive/coal/upload_io.rb
Instance Method Summary collapse
-
#initialize(filename_or_io, content_type = nil, filename = nil) ⇒ UploadIO
constructor
A new instance of UploadIO.
Constructor Details
#initialize(filename_or_io, content_type = nil, filename = nil) ⇒ UploadIO
Returns a new instance of UploadIO.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/locomotive/coal/upload_io.rb', line 5 def initialize(filename_or_io, content_type = nil, filename = nil) if filename.blank? && filename_or_io.is_a?(String) filename = File.basename(filename_or_io) end super( filename_or_io, content_type || MIME::Types.type_for(filename).first || 'application/octet-stream', filename ) end |