Module: TimeZoneWarp

Defined in:
lib/time_zone_warp.rb

Instance Method Summary collapse

Instance Method Details

#pretend_zone_is(zone) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/time_zone_warp.rb', line 4

def pretend_zone_is(zone)
  original_zone = Time.zone
  begin
    Time.zone = zone
    yield
  ensure
    Time.zone = original_zone
  end
end