Class: Diffed::Diff

Inherits:
Object
  • Object
show all
Defined in:
lib/diffed.rb

Defined Under Namespace

Classes: OutputRow

Instance Method Summary collapse

Constructor Details

#initialize(lines) ⇒ Diff



15
16
17
# File 'lib/diffed.rb', line 15

def initialize(lines)
  parse(lines)      
end

Instance Method Details

#as_html_table(use_inline_styles = true) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/diffed.rb', line 19

def as_html_table(use_inline_styles = true)
  html = make_table_tag(use_inline_styles)
  
  @sections.each do |section|
    html << format_section_header_row(section.header, use_inline_styles)        
    section.lines.each_with_index do |line, i|
      html << format_code_line(line, use_inline_styles)
    end
  end

  html << "</table>"
end