Class: Evilution::Reporter::CLI::LineFormatters::Efficiency Private
- Inherits:
-
Object
- Object
- Evilution::Reporter::CLI::LineFormatters::Efficiency
- Defined in:
- lib/evilution/reporter/cli/line_formatters/efficiency.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #format(summary) ⇒ Object private
-
#initialize(pct: Evilution::Reporter::CLI::Pct.new) ⇒ Efficiency
constructor
private
A new instance of Efficiency.
Constructor Details
#initialize(pct: Evilution::Reporter::CLI::Pct.new) ⇒ Efficiency
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Efficiency.
7 8 9 |
# File 'lib/evilution/reporter/cli/line_formatters/efficiency.rb', line 7 def initialize(pct: Evilution::Reporter::CLI::Pct.new) @pct = pct end |
Instance Method Details
#format(summary) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 14 15 16 17 |
# File 'lib/evilution/reporter/cli/line_formatters/efficiency.rb', line 11 def format(summary) return nil unless summary.duration.positive? pct = @pct.format(summary.efficiency) rate = Kernel.format("%.2f", summary.mutations_per_second) "Efficiency: #{pct} killtime, #{rate} mutations/s" end |