Class: Corundum::QA::ReportFormatter
- Inherits:
-
Object
- Object
- Corundum::QA::ReportFormatter
- Defined in:
- lib/corundum/qa-report.rb
Overview
Adopted gratefully from Xavier Shay’s Cane
Instance Attribute Summary collapse
-
#reports ⇒ Object
readonly
Returns the value of attribute reports.
Instance Method Summary collapse
-
#initialize(reports) ⇒ ReportFormatter
constructor
A new instance of ReportFormatter.
- #to_s ⇒ Object
Constructor Details
#initialize(reports) ⇒ ReportFormatter
Returns a new instance of ReportFormatter.
7 8 9 |
# File 'lib/corundum/qa-report.rb', line 7 def initialize(reports) @reports = reports end |
Instance Attribute Details
#reports ⇒ Object (readonly)
Returns the value of attribute reports.
10 11 12 |
# File 'lib/corundum/qa-report.rb', line 10 def reports @reports end |
Instance Method Details
#to_s ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/corundum/qa-report.rb', line 12 def to_s return "" if reports.empty? widths = column_widths(reports) reports.map do |report| report.to_s(widths) end.join("\n") + "\n\n" + totals + "\n\n" end |