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

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

Instance Method Summary collapse

Instance Method Details

#change(event) ⇒ Object



46
47
48
49
50
51
52
53
54
55
# File 'lib/super_diff/operation_tree_builders/array.rb', line 46

def change(event)
  child_operations = sequence.call(event.old_element, event.new_element)

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

#discard_a(event) ⇒ Object



38
39
40
# File 'lib/super_diff/operation_tree_builders/array.rb', line 38

def discard_a(event)
  add_delete_operation(event)
end

#discard_b(event) ⇒ Object



42
43
44
# File 'lib/super_diff/operation_tree_builders/array.rb', line 42

def discard_b(event)
  add_insert_operation(event)
end

#match(event) ⇒ Object



34
35
36
# File 'lib/super_diff/operation_tree_builders/array.rb', line 34

def match(event)
  add_noop_operation(event)
end