Sha256: d418339b2d5f3ba2149b51963b902b2d56cca2173a431a843df3e83f79f29503
Contents?: true
Size: 405 Bytes
Versions: 11
Compression:
Stored size: 405 Bytes
Contents
# The miminum methods that any IOStreams Reader must implement. class MinimalFileReader def self.open(file_name) io = new(file_name) yield(io) ensure io.close if io end def initialize(file_name) @file = File.open(file_name) end def read(size = nil, outbuf = nil) @file.read(size, outbuf) end def close @file.close end def closed? @file.closed end end
Version data entries
11 entries across 11 versions & 1 rubygems