edge badge
Methods
D
T
Instance Private methods
download_blob_to(file)

Efficiently downloads blob data into the given file.

# File activestorage/lib/active_storage/downloading.rb, line 14
def download_blob_to(file) # :doc:
  file.binmode
  blob.download { |chunk| file.write(chunk) }
  file.rewind
end
download_blob_to_tempfile()

Opens a new tempfile in tempdir and copies blob data into it. Yields the tempfile.

# File activestorage/lib/active_storage/downloading.rb, line 6
def download_blob_to_tempfile # :doc:
  Tempfile.open("ActiveStorage", tempdir) do |file|
    download_blob_to file
    yield file
  end
end
tempdir()

Returns the directory in which tempfiles should be opened. Defaults to Dir.tmpdir.

# File activestorage/lib/active_storage/downloading.rb, line 21
def tempdir # :doc:
  Dir.tmpdir
end