Class: Timebomb::CLIReport

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

Constant Summary collapse

RED_COLOR_CODE =
31
EXPLODED_CHARACTER =
"💥"
UNEXPLODED_CHARACTER =
"💣"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(suite) ⇒ CLIReport

Returns a new instance of CLIReport.



116
117
118
# File 'lib/timebomb.rb', line 116

def initialize(suite)
  @suite = suite
end

Instance Attribute Details

#suiteObject (readonly)

Returns the value of attribute suite.



114
115
116
# File 'lib/timebomb.rb', line 114

def suite
  @suite
end

Instance Method Details



120
121
122
123
124
125
126
127
128
# File 'lib/timebomb.rb', line 120

def print(out)
  out.puts "Detected #{suite.timebombs.count} timebombs"
  suite.timebombs.each do |tb|
    out.puts row " #{explosion_symbol(tb)} ", format_date(tb.date), days_until(tb), tb.title
  end
  if suite.has_exploded?
    out.puts "#{suite.exploded_timebombs.count} timebombs have exploded!"
  end
end