module Shrine::Plugins::Tempfile::ClassMethods

  1. lib/shrine/plugins/tempfile.rb

Methods

Public Instance

  1. with_file

Public Instance methods

with_file(io)
[show source]
   # File lib/shrine/plugins/tempfile.rb
 8 def with_file(io)
 9   if io.is_a?(UploadedFile) && io.opened?
10     # open a new file descriptor for thread safety
11     File.open(io.tempfile.path, binmode: true) do |file|
12       yield file
13     end
14   else
15     super
16   end
17 end