Class: DeloreanTestBed::FluxCapacitorController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- DeloreanTestBed::FluxCapacitorController
- Defined in:
- app/controllers/delorean_test_bed/flux_capacitor_controller.rb
Instance Method Summary collapse
Instance Method Details
#accelerate_to_eighty_eight ⇒ Object
27 28 29 30 31 32 33 |
# File 'app/controllers/delorean_test_bed/flux_capacitor_controller.rb', line 27 def accelerate_to_eighty_eight DeloreanTestBed::cache.write(:future, DateTime.new( *params[:date].values.map(&:to_i) )) Timecop.travel(DeloreanTestBed::cache.read(:future)) redirect_to root_path end |
#flux ⇒ Object
21 22 23 24 25 |
# File 'app/controllers/delorean_test_bed/flux_capacitor_controller.rb', line 21 def flux DeloreanTestBed::cache.write(:scale, params[:scale]) Timecop.scale(params[:scale].to_i) redirect_to root_path end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/delorean_test_bed/flux_capacitor_controller.rb', line 5 def index @scale = DeloreanTestBed::cache.read(:future).to_i end |
#pause ⇒ Object
15 16 17 18 19 |
# File 'app/controllers/delorean_test_bed/flux_capacitor_controller.rb', line 15 def pause DeloreanTestBed::cache.write(:pause, Time.now) Timecop.freeze(DeloreanTestBed::cache.read(:pause)) redirect_to root_path end |
#start ⇒ Object
9 10 11 12 13 |
# File 'app/controllers/delorean_test_bed/flux_capacitor_controller.rb', line 9 def start DeloreanTestBed::cache.write(:start, Time.now) Timecop.return redirect_to root_path end |