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

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

Instance Method Summary collapse

Constructor Details

#initialize(list) ⇒ ExcludeeIterator

Returns a new instance of ExcludeeIterator.



225
226
227
228
229
# File 'lib/card/diff/lcs.rb', line 225

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

Instance Method Details

#nextObject



235
236
237
238
239
240
241
242
243
# File 'lib/card/diff/lcs.rb', line 235

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



231
232
233
# File 'lib/card/diff/lcs.rb', line 231

def word_step
  @chunk_index += 1
end