Module: QAT::Reporter::Times::Report
Overview
Namespace for Times Report outputs
Class Method Summary collapse
-
.table(data) ⇒ String
Builds an ascii table time report for console output.
Methods included from Helpers::TimeFormat
Class Method Details
.table(data) ⇒ String
Builds an ascii table time report for console output
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/qat/reporter/times/report.rb', line 15 def self.table(data) if data.any? table_data = data.map do |_, measure| { 'Interaction' => measure[:name], 'Start' => measure[:start].strftime('%Y-%m-%d %H:%M:%S %z'), 'End' => measure[:end].strftime('%Y-%m-%d %H:%M:%S %z'), 'Duration' => human_formatted_time(measure[:duration]), } end QAT::Reporter::Helpers::AsciiTable.new(table_data).to_s else "No time measure was recorded!" end end |