Class: Diffy::HtmlFormatter
- Inherits:
-
Object
- Object
- Diffy::HtmlFormatter
- Defined in:
- lib/diffy/html_formatter.rb
Instance Method Summary collapse
-
#initialize(diff, options = {}) ⇒ HtmlFormatter
constructor
A new instance of HtmlFormatter.
- #to_s ⇒ Object
Constructor Details
#initialize(diff, options = {}) ⇒ HtmlFormatter
Returns a new instance of HtmlFormatter.
3 4 5 6 |
# File 'lib/diffy/html_formatter.rb', line 3 def initialize(diff, = {}) @diff = diff @options = end |
Instance Method Details
#to_s ⇒ Object
8 9 10 11 12 13 14 |
# 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 |