Class: SuperDiff::Basic::OperationTreeBuilders::Array::LcsCallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/super_diff/basic/operation_tree_builders/array.rb

Instance Method Summary collapse

Instance Method Details

#change(event) ⇒ Object



52
53
54
55
56
57
58
59
60
61
# File 'lib/super_diff/basic/operation_tree_builders/array.rb', line 52

def change(event)
  children = compare.call(event.old_element, event.new_element)

  if children
    add_change_operation(event, children)
  else
    add_delete_operation(event)
    add_insert_operation(event)
  end
end

#discard_a(event) ⇒ Object



44
45
46
# File 'lib/super_diff/basic/operation_tree_builders/array.rb', line 44

def discard_a(event)
  add_delete_operation(event)
end

#discard_b(event) ⇒ Object



48
49
50
# File 'lib/super_diff/basic/operation_tree_builders/array.rb', line 48

def discard_b(event)
  add_insert_operation(event)
end

#match(event) ⇒ Object



40
41
42
# File 'lib/super_diff/basic/operation_tree_builders/array.rb', line 40

def match(event)
  add_noop_operation(event)
end