Top Level Namespace

Defined Under Namespace

Modules: TimeTravel

Instance Method Summary collapse

Instance Method Details

#at_time(time) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/time_travel.rb', line 9

def at_time(time)
  Time.now = time
  begin
    yield Time.now
  ensure
    Time.now = nil
  end
end