Class: PrettyDiff::BasicGenerator::LineGen

Inherits:
AbstractGenerator show all
Defined in:
lib/pretty_diff/basic_generator.rb

Instance Method Summary collapse

Methods inherited from AbstractGenerator

[], #initialize

Constructor Details

This class inherits a constructor from PrettyDiff::AbstractGenerator

Instance Method Details

#generateObject



57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/pretty_diff/basic_generator.rb', line 57

def generate
  if line.added?
    (:span, :class => 'diff-line-add') do
      h(line.contents)
    end
  elsif line.deleted?
    (:span, :class => 'diff-line-del') do
      h(line.contents)
    end
  else
    h(line.contents)
  end
end