# File lib/ole/ranges_io.rb, line 111 def offset_and_size pos total = 0 ranges.each_with_index do |(offset, size), i| if pos <= total + size diff = pos - total return [offset + diff, size - diff], i end total += size end # should be impossible for any valid pos, (0...size) === pos raise ArgumentError, "no range for pos #{pos.inspect}" end