Class: Diffed::Diff
- Inherits:
-
Object
- Object
- Diffed::Diff
- Defined in:
- lib/diffed.rb
Defined Under Namespace
Classes: OutputRow
Instance Attribute Summary collapse
-
#sections ⇒ Object
Returns the value of attribute sections.
Instance Method Summary collapse
- #as_html_table(use_inline_styles = true) ⇒ Object
-
#initialize(lines) ⇒ Diff
constructor
A new instance of Diff.
Constructor Details
#initialize(lines) ⇒ Diff
Returns a new instance of Diff.
17 18 19 |
# File 'lib/diffed.rb', line 17 def initialize(lines) parse(lines) end |
Instance Attribute Details
#sections ⇒ Object
Returns the value of attribute sections.
15 16 17 |
# File 'lib/diffed.rb', line 15 def sections @sections end |
Instance Method Details
#as_html_table(use_inline_styles = true) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/diffed.rb', line 21 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 |