Class: Differ
- Inherits:
-
Struct
- Object
- Struct
- Differ
- Defined in:
- lib/differ.rb,
lib/differ.rb
Instance Attribute Summary collapse
-
#target ⇒ Object
Returns the value of attribute target.
Instance Method Summary collapse
Instance Attribute Details
#target ⇒ Object
Returns the value of attribute target
20 21 22 |
# File 'lib/differ.rb', line 20 def target @target end |
Instance Method Details
#diff(old_elems, new_elems) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/differ.rb', line 23 def diff(old_elems, new_elems) sdiffs = old_elems.sdiff(new_elems) last_action = nil sdiffs.each do |sdiff| if chunk_break_needed(last_action, sdiff.action) target.start_new_chunk(sdiff.action) end last_action = sdiff.action target.store_diff(sdiff) end target.get_result end |