Class: TimecopController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/timecop-console/controllers/timecop_controller.rb

Instance Method Summary collapse

Instance Method Details

#resetObject



16
17
18
19
# File 'lib/timecop-console/controllers/timecop_controller.rb', line 16

def reset
  session[:timecop_adjusted_time] = nil
  render :status => 200, :nothing => true
end

#updateObject



10
11
12
13
14
# File 'lib/timecop-console/controllers/timecop_controller.rb', line 10

def update
  year, month, day, hour, min, sec = params[:year], params[:month], params[:day], params[:hour], params[:min], params[:sec]
  session[:timecop_adjusted_time] = Time.local(year, month, day, hour, min, sec)
  render :status => 200, :nothing => true
end