Module: Shrine::Plugins::Tempfile::FileMethods

Defined in:
lib/shrine/plugins/tempfile.rb

Instance Method Summary collapse

Instance Method Details

#closeObject



31
32
33
34
35
36
# File 'lib/shrine/plugins/tempfile.rb', line 31

def close
  super

  @tempfile.close! if @tempfile
  @tempfile = nil
end

#tempfileObject

Raises:



23
24
25
26
27
28
29
# File 'lib/shrine/plugins/tempfile.rb', line 23

def tempfile
  raise Error, "uploaded file must be opened" unless @io

  @tempfile ||= download
  @tempfile.rewind
  @tempfile
end