Class: PigCI::Decorator::ReportTerminalDecorator

Inherits:
PigCI::Decorator show all
Defined in:
lib/pig_ci/decorator/report_terminal_decorator.rb

Instance Attribute Summary

Attributes inherited from PigCI::Decorator

#object

Instance Method Summary collapse

Methods inherited from PigCI::Decorator

#initialize

Constructor Details

This class inherits a constructor from PigCI::Decorator

Instance Method Details

#max_change_percentageObject


10
11
12
13
14
15
16
17
18
# File 'lib/pig_ci/decorator/report_terminal_decorator.rb', line 10

def max_change_percentage
  if @object[:max_change_percentage].start_with?('-')
    ColorizedString[@object[:max_change_percentage]].colorize(:green)
  elsif @object[:max_change_percentage].start_with?('0.0')
    @object[:max_change_percentage]
  else
    ColorizedString[@object[:max_change_percentage]].colorize(:red)
  end
end