Class: File
- Inherits:
-
Object
- Object
- File
- Defined in:
- lib/io-segmenter/core_ext/file.rb
Class Method Summary collapse
Class Method Details
.each_segment(file, *args, max_read_size, &block) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/io-segmenter/core_ext/file.rb', line 2 def self.each_segment(file, *args, max_read_size, &block) handle = open(file, 'rb') IOSegmenter::Reader.new(handle, IOSegmenter::Parser.new(*args), max_read_size).each(&block) ensure handle && handle.close end |