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.

Instance Attribute Summary

Attributes inherited from RangesIO

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

Instance Method Summary collapse

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