Class: Diff::LCS::DefaultCallbacks

Inherits:
Object
  • Object
show all
Defined in:
lib/diff/lcs/callbacks.rb

Overview

This callback object implements the default set of callback events, which only returns the event itself. Note that #finished_a and #finished_b are not implemented -- I haven't yet figured out where they would be useful.

Note that this is intended to be called as is, e.g.,

Diff::LCS.LCS(seq1, seq2, Diff::LCS::DefaultCallbacks)

Class Method Summary (collapse)

Class Method Details

+ (Object) change(event)

Called when both the old and new values have changed.



34
35
36
# File 'lib/diff/lcs/callbacks.rb', line 34

def change(event)
  event
end

+ (Object) discard_a(event)

Called when the old value is discarded in favour of the new value.



26
27
28
# File 'lib/diff/lcs/callbacks.rb', line 26

def discard_a(event)
  event
end

+ (Object) discard_b(event)

Called when the new value is discarded in favour of the old value.



30
31
32
# File 'lib/diff/lcs/callbacks.rb', line 30

def discard_b(event)
  event
end

+ (Object) match(event)

Called when two items match.



22
23
24
# File 'lib/diff/lcs/callbacks.rb', line 22

def match(event)
  event
end