Class: AgentC::Costs::Report::Printer
- Inherits:
-
Object
- Object
- AgentC::Costs::Report::Printer
- Defined in:
- lib/agent_c/costs/report.rb
Overview
Printer class for formatting output
Instance Method Summary collapse
-
#initialize(out: $stdout) ⇒ Printer
constructor
A new instance of Printer.
- #print_hierarchical_report(computations) ⇒ Object
Constructor Details
#initialize(out: $stdout) ⇒ Printer
Returns a new instance of Printer.
179 180 181 |
# File 'lib/agent_c/costs/report.rb', line 179 def initialize(out: $stdout) @out = out end |
Instance Method Details
#print_hierarchical_report(computations) ⇒ Object
183 184 185 186 187 188 |
# File 'lib/agent_c/costs/report.rb', line 183 def print_hierarchical_report(computations) computations.each_with_index do |computation, index| print_section(computation[:label], computation[:stats], computation[:messages]) @out.puts "" if index < computations.length - 1 end end |