class Diffy::HtmlFormatter

Public Class Methods

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

Public Instance Methods

to_s() click to toggle 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