Class: WordRunDiffLCS::WordRunContextChangeSequence
- Inherits:
-
Object
- Object
- WordRunDiffLCS::WordRunContextChangeSequence
- Defined in:
- lib/word_run_diff_lcs.rb
Instance Method Summary collapse
- #<<(diff_lcs_context_change) ⇒ Object
-
#initialize ⇒ WordRunContextChangeSequence
constructor
A new instance of WordRunContextChangeSequence.
- #map(&block) ⇒ Object
Constructor Details
#initialize ⇒ WordRunContextChangeSequence
Returns a new instance of WordRunContextChangeSequence.
29 30 31 |
# File 'lib/word_run_diff_lcs.rb', line 29 def initialize @word_run_context_changes = [ ] end |
Instance Method Details
#<<(diff_lcs_context_change) ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/word_run_diff_lcs.rb', line 33 def <<(diff_lcs_context_change) word_run_context_change = WordRunContextChange.new(diff_lcs_context_change) if empty? @word_run_context_changes << word_run_context_change else @word_run_context_changes << word_run_context_change unless last.merge!(word_run_context_change) end end |
#map(&block) ⇒ Object
42 43 44 |
# File 'lib/word_run_diff_lcs.rb', line 42 def map(&block) @word_run_context_changes.map(&block) end |