Class: Lemans::Clobber
- Inherits:
-
Object
- Object
- Lemans::Clobber
- Includes:
- Lemans::Config::Conversion
- Defined in:
- lib/lemans/clobber.rb
Overview
Deletes stored results based on the provided filters.
Constant Summary
Constants included from Lemans::Config::Conversion
Lemans::Config::Conversion::DURATION, Lemans::Config::Conversion::DURATION_FACTORS, Lemans::Config::Conversion::SIZE, Lemans::Config::Conversion::SIZE_FACTORS
Instance Method Summary collapse
- #execute! ⇒ Object
-
#initialize(store, tasks: [], ttl: nil, invalid: false) ⇒ Clobber
constructor
A new instance of Clobber.
- #matches ⇒ Object
Methods included from Lemans::Config::Conversion
#absolute_path!, #float!, #integer!, #megabytes!, #seconds!
Constructor Details
#initialize(store, tasks: [], ttl: nil, invalid: false) ⇒ Clobber
Returns a new instance of Clobber.
10 11 12 13 14 15 |
# File 'lib/lemans/clobber.rb', line 10 def initialize(store, tasks: [], ttl: nil, invalid: false) @store = store @tasks = Array(tasks) @ttl = ttl && seconds!(ttl) @invalid = invalid end |
Instance Method Details
#execute! ⇒ Object
21 22 23 |
# File 'lib/lemans/clobber.rb', line 21 def execute! matches.select { store.delete(it) } end |
#matches ⇒ Object
17 18 19 |
# File 'lib/lemans/clobber.rb', line 17 def matches @matches ||= select_matches end |