Class: Timebomb::Suite
- Inherits:
-
Object
- Object
- Timebomb::Suite
- Defined in:
- lib/timebomb.rb
Instance Method Summary collapse
- #exploded_timebombs ⇒ Object
- #has_exploded? ⇒ Boolean
- #load_files(paths) ⇒ Object
- #timebomb_files ⇒ Object
- #timebombs ⇒ Object
- #unexploded_timebombs ⇒ Object
Instance Method Details
#exploded_timebombs ⇒ Object
231 232 233 |
# File 'lib/timebomb.rb', line 231 def exploded_timebombs timebombs.lazy.select(&:has_exploded?) end |
#has_exploded? ⇒ Boolean
227 228 229 |
# File 'lib/timebomb.rb', line 227 def has_exploded? exploded_timebombs.any? end |
#load_files(paths) ⇒ Object
221 222 223 224 225 |
# File 'lib/timebomb.rb', line 221 def load_files(paths) paths.each do |path| self.timebomb_files << BombFile.new(path) end end |
#timebomb_files ⇒ Object
246 247 248 |
# File 'lib/timebomb.rb', line 246 def timebomb_files @timebomb_files ||= [] end |
#timebombs ⇒ Object
239 240 241 242 243 244 |
# File 'lib/timebomb.rb', line 239 def timebombs timebomb_files.map do |file| file.read file.bomb end end |
#unexploded_timebombs ⇒ Object
235 236 237 |
# File 'lib/timebomb.rb', line 235 def unexploded_timebombs timebombs.lazy.reject(&:has_exploded?) end |