class Rack::Files::Iterator
Attributes
path[R]
range[R]
to_path[R]
Public Class Methods
new(path, range)
click to toggle source
# File lib/rack/files.rb, line 110 def initialize path, range @path = path @range = range end
Public Instance Methods
close()
click to toggle source
# File lib/rack/files.rb, line 129 def close; end
each() { |part| ... }
click to toggle source
# File lib/rack/files.rb, line 115 def each ::File.open(path, "rb") do |file| file.seek(range.begin) remaining_len = range.end - range.begin + 1 while remaining_len > 0 part = file.read([8192, remaining_len].min) break unless part remaining_len -= part.length yield part end end end