class ActionDispatch::Response::FileBody
:nodoc:
the path directly, so there is no reason to open the file.
Rack::Sendfile will usually intercept the response and uses
Avoid having to pass an open file handle as the response body.
def body
def body File.binread(to_path) end
def each
def each File.open(to_path, "rb") do |file| while chunk = file.read(16384) yield chunk end end end
def initialize(path)
def initialize(path) @to_path = path end