Class: TimepieceController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- TimepieceController
- Defined in:
- app/controllers/timepiece_controller.rb
Instance Method Summary collapse
Instance Method Details
#clock ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'app/controllers/timepiece_controller.rb', line 5 def clock arr = Array.new params[:timezones].each_with_index do | data, index | zone = Time.now.in_time_zone(data) time = { :hours => zone.strftime('%H'), :minutes => zone.strftime('%M'), :seconds => zone.strftime('%S') } arr << time end respond_to do |format| format.json { render :json => arr } end end |