# File lib/delorean.rb, line 16 def back_to_the_present reset end
# File lib/delorean.rb, line 21 def jump(seconds) mock_current_time Time.now + seconds return unless block_given? begin yield ensure restore_previous_time end end
# File lib/delorean.rb, line 31 def now Time.now_without_delorean - time_travel_offsets.inject(0){ |sum, val| sum + val } end
# File lib/delorean.rb, line 6 def time_travel_to(time, options={}) mock_current_time(time, options) return unless block_given? begin yield ensure restore_previous_time end end