Class: Card::Diff::DiffBuilder::LCS::ExcludeeIterator

Inherits:
Object
  • Object
show all
Defined in:
lib/card/diff.rb

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ ExcludeeIterator

Returns a new instance of ExcludeeIterator.



407
408
409
410
411
# File 'lib/card/diff.rb', line 407

def initialize list
  @list = list
  @index = 0
  @chunk_index = 0
end

Instance Method Details

#nextObject



417
418
419
420
421
422
423
424
# File 'lib/card/diff.rb', line 417

def next
  if @index < @list.size and @list[@index][:chunk_index] == @chunk_index
    res = @list[@index]
    @index += 1
    @chunk_index +=1
    res
  end
end

#word_stepObject



413
414
415
# File 'lib/card/diff.rb', line 413

def word_step
  @chunk_index += 1
end