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.



421
422
423
424
425
# File 'lib/card/diff.rb', line 421

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

Instance Method Details

#nextObject



431
432
433
434
435
436
437
438
# File 'lib/card/diff.rb', line 431

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

#word_stepObject



427
428
429
# File 'lib/card/diff.rb', line 427

def word_step
  @chunk_index += 1
end