Class: Card::Diff::LCS::ExcludeeIterator
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.
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
#next ⇒ Object
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_step ⇒ Object
231 232 233 |
# File 'lib/card/diff/lcs.rb', line 231 def word_step @chunk_index += 1 end |