Class: WBench::RowFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/wbench/row_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(name, data) ⇒ RowFormatter

Returns a new instance of RowFormatter.



3
4
5
6
# File 'lib/wbench/row_formatter.rb', line 3

def initialize(name, data)
  @name  = name
  @stats = Stats.new(data)
end

Instance Method Details

#to_sObject



8
9
10
11
12
13
14
# File 'lib/wbench/row_formatter.rb', line 8

def to_s
  if @stats.compact.size == 0
    name_s + no_result_s
  else
    name_s + fastest_s + median_s + slowest_s + std_dev_s
  end
end