Class: WheneverDelorean

Inherits:
Object
  • Object
show all
Defined in:
lib/whenever-delorean.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time, options) ⇒ WheneverDelorean

Returns a new instance of WheneverDelorean.



8
9
10
11
12
# File 'lib/whenever-delorean.rb', line 8

def initialize(time, options)
  @destination_time = parse_date(time)
  @match = options[:only]
  raise 'must set the :only => //, option' unless @match
end

Class Method Details

.time_travel_to(*arguments) ⇒ Object



14
15
16
# File 'lib/whenever-delorean.rb', line 14

def self.time_travel_to(*arguments)
  WheneverDelorean.new(*arguments).time_travel
end

Instance Method Details

#time_travelObject



18
19
20
21
# File 'lib/whenever-delorean.rb', line 18

def time_travel
  run_jobs
  Delorean.time_travel_to(destination_time)
end