This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/lib/grid_io.rb

23 lines
339 B
Ruby

require 'mongo'
module PrototypeR4
module GridIO
def self.included(base)
base.class_eval do
def size
(file_length / chunk_size) + (file_length % chunk_size > 0 ? 1 : 0)
end
def each(&block)
size.times { block.call(read(chunk_size)) }
end
end
end
end
end