Class: Card::Diff::DiffBuilder::LCS::ExcludeeIterator
- Defined in:
- lib/card/diff.rb
Instance Method Summary collapse
-
#initialize(list) ⇒ ExcludeeIterator
constructor
A new instance of ExcludeeIterator.
- #next ⇒ Object
- #word_step ⇒ Object
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
#next ⇒ Object
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_step ⇒ Object
427 428 429 |
# File 'lib/card/diff.rb', line 427 def word_step @chunk_index += 1 end |