Class: Diff::LCS::HTMLDiff::Callbacks

### Home Classes Methods

### In Files

- lib/diff/lcs/htmldiff.rb

### Parent

Object

### Methods

- ::new
- #discard_a
- #discard_b
- #match

### Files

- Manifest.txt
- README.rdoc
- COPYING.txt
- artistic.txt

### Class/Module Index

Quicksearch

- Diff
- Diff::LCS
- Diff::LCS::BalancedCallbacks
- Diff::LCS::Block
- Diff::LCS::Change
- Diff::LCS::ContextChange
- Diff::LCS::ContextDiffCallbacks
- Diff::LCS::DefaultCallbacks
- Diff::LCS::DiffCallbacks
- Diff::LCS::HTMLDiff
- Diff::LCS::HTMLDiff::Callbacks
- Diff::LCS::Hunk
- Diff::LCS::Ldiff
- Diff::LCS::SDiffCallbacks
- Diff::LCS::SequenceCallbacks
- Array
- String

No matching classes.

# Diff::LCS::HTMLDiff::Callbacks

### Attributes

match_class[RW]
only_a_class[RW]
only_b_class[RW]
output[RW]

### Public Class Methods

new(output, options = {}) click to toggle source

    # File lib/diff/lcs/htmldiff.rb, line 16
    def initialize(output, options = {})
      @output = output
      options ||= {}

      @match_class = options[:match_class] || "match"
      @only_a_class = options[:only_a_class] || "only_a"
      @only_b_class = options[:only_b_class] || "only_b"
    end

### Public Instance Methods

discard_a(event) click to toggle source

This will be called when there is a line in A that isn't in B

    # File lib/diff/lcs/htmldiff.rb, line 37
    def discard_a(event)
      @output << htmlize(event.old_element, :only_a_class)
    end

discard_b(event) click to toggle source

This will be called when there is a line in B that isn't in A

    # File lib/diff/lcs/htmldiff.rb, line 42
    def discard_b(event)
      @output << htmlize(event.new_element, :only_b_class)
    end

match(event) click to toggle source

This will be called with both lines are the same

    # File lib/diff/lcs/htmldiff.rb, line 32
    def match(event)
      @output << htmlize(event.old_element, :match_class)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.