Sha256: fc583b79be9204785e82870effd9358bea9e722ee54c6a416643341939cc2615
Contents?: true
Size: 400 Bytes
Versions: 20
Compression:
Stored size: 400 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 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
20 entries across 20 versions & 1 rubygems