In Files

Class/Module Index [+]

Quicksearch

Delorean

Public Instance Methods

back_to_1985() click to toggle source
Alias for: back_to_the_present
back_to_the_present() click to toggle source
# File lib/delorean.rb, line 16
def back_to_the_present
  reset
end
Also aliased as: back_to_1985
jump(seconds) click to toggle source
# 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
now() click to toggle source
# File lib/delorean.rb, line 31
def now
  Time.now_without_delorean - time_travel_offsets.inject(0){ |sum, val| sum + val }
end
time_travel_to(time, options={}) click to toggle source
# 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

[Validate]

Generated with the Darkfish Rdoc Generator 2.