Class Diffy::HtmlFormatter
In: lib/diffy/html_formatter.rb
Parent: Object

Methods

new   to_s  

Public Class methods

[Source]

# File lib/diffy/html_formatter.rb, line 3
    def initialize(diff, options = {})
      @diff = diff
      @options = options
    end

Public Instance methods

[Source]

# File lib/diffy/html_formatter.rb, line 8
    def to_s
      if @options[:highlight_words]
        wrap_lines(highlighted_words)
      else
        wrap_lines(@diff.map{|line| wrap_line(ERB::Util.h(line))})
      end
    end

[Validate]