class XHTMLDiff::XHTMLTextDiff

Public Instance Methods

change(event) click to toggle source
# File lib/xhtmldiff.rb, line 129
def change(event)
        @output << wrap(event.old_element, 'del')
        @output << wrap(event.new_element, 'ins')
end
discard_a(event) click to toggle source

This will be called when there is an element in A that isn't in B

# File lib/xhtmldiff.rb, line 140
def discard_a(event)
        @output << wrap(event.old_element, 'del') 
end
discard_b(event) click to toggle source

This will be called when there is an element in B that isn't in A

# File lib/xhtmldiff.rb, line 145
def discard_b(event)
        @output << wrap(event.new_element, 'ins')
end
match(event) click to toggle source

This will be called with both elements are the same

# File lib/xhtmldiff.rb, line 135
def match(event)
        @output << wrap(event.old_element, nil) if event.old_element
end
wrap(element, tag) click to toggle source
Calls superclass method XHTMLDiff#wrap
# File lib/xhtmldiff.rb, line 149
def wrap(element, tag)
        element = REXML::Text.new(" " << element) if String === element
        super element, tag
end