Class: PulseAnalysis::Console::Table
- Inherits:
-
Object
- Object
- PulseAnalysis::Console::Table
- Defined in:
- lib/pulse-analysis/console/table.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
Class Method Summary collapse
Instance Method Summary collapse
-
#build ⇒ Terminal::Table
Populate the table content.
-
#initialize(report) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(report) ⇒ Table
Returns a new instance of Table.
20 21 22 |
# File 'lib/pulse-analysis/console/table.rb', line 20 def initialize(report) @report = report end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
9 10 11 |
# File 'lib/pulse-analysis/console/table.rb', line 9 def content @content end |
Class Method Details
.build(report) ⇒ PulseAnalysis::Console::Table
13 14 15 16 17 |
# File 'lib/pulse-analysis/console/table.rb', line 13 def self.build(report) table = new(report) table.build table end |
Instance Method Details
#build ⇒ Terminal::Table
Populate the table content
26 27 28 29 30 |
# File 'lib/pulse-analysis/console/table.rb', line 26 def build @content = Terminal::Table.new(title: "Pulse Analysis", headings: header) do |table| @report.items.each { |item| table << build_row(item) } end end |