class Sequence::Shifting

a primary sequence (presumably unidirectional) with a secondary sequence as backup. the primary is traversed in the forward direcion only. the secondary holds a copy of data as it comes from the primary sequence. the position can be independantly changed to any location; if before the current position of the primary sequence, the secondary sequence is used instead. all writes go to the secondary sequence.

Public Class Methods

new(seq,data= Sequence::Indexed.new(seq.new_data)) click to toggle source
# File lib/sequence/shifting.rb, line 17
def initialize(seq,data= Sequence::Indexed.new(seq.new_data))
    @seq=seq #primary
    @data = data   #secondary
    @offset=@seq.pos
    
    extend @seq.like
    
    @seq.on_change_notify self
end