Class: AgentC::Costs::Report::Printer

Inherits:
Object
  • Object
show all
Defined in:
lib/agent_c/costs/report.rb

Overview

Printer class for formatting output

Instance Method Summary collapse

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



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