2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
class CarrierWaveStringFile < StringIO
|
|
|
|
def original_filename
|
|
|
|
""
|
|
|
|
end
|
2020-11-24 15:15:51 +05:30
|
|
|
|
|
|
|
def self.new_file(file_content:, filename:, content_type: "application/octet-stream")
|
|
|
|
{
|
|
|
|
"tempfile" => StringIO.new(file_content),
|
|
|
|
"filename" => filename,
|
|
|
|
"content_type" => content_type
|
|
|
|
}
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
end
|