Class: Ea::Diff::HtmlReporter
- Inherits:
-
Object
- Object
- Ea::Diff::HtmlReporter
- Defined in:
- lib/ea/diff/html_reporter.rb
Overview
Renders a Comparator's differences as an HTML report with color-coded rows. Useful for CI artifacts and PR review.
Instance Attribute Summary collapse
-
#comparator ⇒ Object
readonly
Returns the value of attribute comparator.
Instance Method Summary collapse
-
#initialize(comparator) ⇒ HtmlReporter
constructor
A new instance of HtmlReporter.
-
#render ⇒ String
Standalone HTML document.
Constructor Details
#initialize(comparator) ⇒ HtmlReporter
Returns a new instance of HtmlReporter.
10 11 12 |
# File 'lib/ea/diff/html_reporter.rb', line 10 def initialize(comparator) @comparator = comparator end |
Instance Attribute Details
#comparator ⇒ Object (readonly)
Returns the value of attribute comparator.
8 9 10 |
# File 'lib/ea/diff/html_reporter.rb', line 8 def comparator @comparator end |
Instance Method Details
#render ⇒ String
Returns standalone HTML document.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ea/diff/html_reporter.rb', line 15 def render <<~HTML <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>EA Diff Report</title> <style>#{css}</style> </head> <body> <h1>EA Diff Report</h1> #{summary_section} #{table_section} </body> </html> HTML end |