Class: RangesIONonResizeable

Inherits:
RangesIO show all
Defined in:
lib/ole/ranges_io.rb

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. added nodoc for the time being.

Instance Attribute Summary

Attributes inherited from RangesIO

#io, #mode, #pos, #ranges, #size

Instance Method Summary collapse

Methods inherited from RangesIO

#close, #eof?, #gets, #inspect, open, #read, #rewind, #truncate, #write

Constructor Details

#initialize(io, mode = 'r', params = {}) ⇒ RangesIONonResizeable

:nodoc:



254
255
256
257
258
# File 'lib/ole/ranges_io.rb', line 254

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