Class: ZSpec::Scheduler
- Inherits:
-
Object
- Object
- ZSpec::Scheduler
- Defined in:
- lib/zspec/scheduler.rb
Instance Method Summary collapse
-
#initialize(queue:, tracker:) ⇒ Scheduler
constructor
A new instance of Scheduler.
- #schedule(args) ⇒ Object
Constructor Details
#initialize(queue:, tracker:) ⇒ Scheduler
Returns a new instance of Scheduler.
3 4 5 6 |
# File 'lib/zspec/scheduler.rb', line 3 def initialize(queue:, tracker:) @queue = queue @tracker = tracker end |
Instance Method Details
#schedule(args) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/zspec/scheduler.rb', line 8 def schedule(args) enqueue( extract(args) .uniq .map(&method(:normalize)) .sort_by(&method(:runtime)) .reverse ) end |