Class: Timebomb::Suite

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

Instance Method Summary collapse

Instance Method Details

#exploded_timebombsObject



231
232
233
# File 'lib/timebomb.rb', line 231

def exploded_timebombs
  timebombs.lazy.select(&:has_exploded?)
end

#has_exploded?Boolean

Returns:

  • (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_filesObject



246
247
248
# File 'lib/timebomb.rb', line 246

def timebomb_files
  @timebomb_files ||= []
end

#timebombsObject



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_timebombsObject



235
236
237
# File 'lib/timebomb.rb', line 235

def unexploded_timebombs
  timebombs.lazy.reject(&:has_exploded?)
end