Module: SimpleImagesDownloader::StringioToTempfile
- Defined in:
- lib/simple_images_downloader/stringio_to_tempfile.rb
Overview
StringIOToTempfile module Responsible for converting StringIO to Tempfile
# => #<Tempfile:0x00007f9b9c0b3a38>
Class Method Summary collapse
-
.convert(stringio) ⇒ Tempfile
Tempfile object.
Class Method Details
.convert(stringio) ⇒ Tempfile
Returns Tempfile object.
16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_images_downloader/stringio_to_tempfile.rb', line 16 def convert(stringio) tempfile = Tempfile.new(binmode: true) IO.copy_stream(stringio, tempfile) OpenURI::Meta.init tempfile, stringio tempfile end |