instance method
stream
Ruby on Rails 6.1.7.10
Since v6.0.6 PrivateSignature
stream(key)
No documentation comment.
Parameters
-
keyreq
Source
# File activestorage/lib/active_storage/service/disk_service.rb, line 138
def stream(key)
File.open(path_for(key), "rb") do |file|
while data = file.read(5.megabytes)
yield data
end
end
rescue Errno::ENOENT
raise ActiveStorage::FileNotFoundError
end
Defined in activestorage/lib/active_storage/service/disk_service.rb line 138
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveStorage::Service::DiskService