Class: Diffed::Section
- Inherits:
-
Object
- Object
- Diffed::Section
- Includes:
- DiffHtml
- Defined in:
- lib/models/section.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
- #as_html_rows(use_inline_styles, row_nums_to_highlight = []) ⇒ Object
-
#initialize(header, lines) ⇒ Section
constructor
A new instance of Section.
Methods included from DiffHtml
Constructor Details
#initialize(header, lines) ⇒ Section
Returns a new instance of Section.
8 9 10 |
# File 'lib/models/section.rb', line 8 def initialize(header, lines) @header, @lines = header, lines end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
6 7 8 |
# File 'lib/models/section.rb', line 6 def header @header end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
6 7 8 |
# File 'lib/models/section.rb', line 6 def lines @lines end |
Instance Method Details
#as_html_rows(use_inline_styles, row_nums_to_highlight = []) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/models/section.rb', line 12 def as_html_rows(use_inline_styles, row_nums_to_highlight = []) html = format_section_header_row(use_inline_styles) lines.each_with_index do |line, i| html << line.as_html_row(use_inline_styles, row_nums_to_highlight.include?(i + 1)) end html end |