summaryrefslogtreecommitdiff
path: root/lib/carrier_wave_string_file.rb
blob: b6bc3d986ca908d9f54e1bb71d1f6143f35366f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# frozen_string_literal: true

class CarrierWaveStringFile < StringIO
  def original_filename
    ""
  end

  def self.new_file(file_content:, filename:, content_type: "application/octet-stream")
    {
      "tempfile" => StringIO.new(file_content),
      "filename" => filename,
      "content_type" => content_type
    }
  end
end