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.
|
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
|
|
|