Class: RangesIONonResizeable
Overview
this subclass of ranges io explicitly ignores the truncate part of ‘w’ modes. only really needed for the allocation table writes etc. maybe just use explicit modes for those better yet write a test that breaks before I fix it.
Instance Attribute Summary
Attributes inherited from RangesIO
#io, #mode, #pos, #ranges, #size
Instance Method Summary collapse
-
#initialize(io, mode = 'r', params = {}) ⇒ RangesIONonResizeable
constructor
A new instance of RangesIONonResizeable.
Methods inherited from RangesIO
#close, #eof?, #gets, #inspect, #offset_and_size, open, #read, #truncate, #write
Constructor Details
#initialize(io, mode = 'r', params = {}) ⇒ RangesIONonResizeable
Returns a new instance of RangesIONonResizeable.
222 223 224 225 226 |
# File 'lib/ole/ranges_io.rb', line 222 def initialize io, mode='r', params={} mode, params = 'r', mode if Hash === mode flags = IO::Mode.new(mode).flags & ~IO::TRUNC super io, flags, params end |