Class: Timebomb::CLIReport
- Inherits:
-
Object
- Object
- Timebomb::CLIReport
- Defined in:
- lib/timebomb.rb
Constant Summary collapse
- RED_COLOR_CODE =
31
- EXPLODED_CHARACTER =
"💥"
- UNEXPLODED_CHARACTER =
"💣"
Instance Attribute Summary collapse
-
#suite ⇒ Object
readonly
Returns the value of attribute suite.
Instance Method Summary collapse
-
#initialize(suite) ⇒ CLIReport
constructor
A new instance of CLIReport.
- #print(out) ⇒ Object
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
#suite ⇒ Object (readonly)
Returns the value of attribute suite.
114 115 116 |
# File 'lib/timebomb.rb', line 114 def suite @suite end |
Instance Method Details
#print(out) ⇒ Object
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 |