Class: Api::V1::LiveEventsController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- Api::V1::LiveEventsController
- Defined in:
- app/controllers/api/v1/live_events_controller.rb
Instance Method Summary collapse
-
#process_event ⇒ Object
rubocop:disable Metrics/AbcSize.
Instance Method Details
#process_event ⇒ Object
rubocop:disable Metrics/AbcSize
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/api/v1/live_events_controller.rb', line 4 def process_event # rubocop:disable Metrics/AbcSize payload = SymmetricEncryption.decrypt(params[:payload]) payload = JSON.parse(payload) Rails.logger.debug("Processing event type: #{payload['attributes']['event_name']}") Rails.logger.debug("Payload: #{payload}") event = "LiveEvents::#{payload['attributes']['event_name'].camelcase}Event".constantize event.perform_later(payload) head :ok rescue => e # rubocop:disable Style/RescueStandardError Rails.logger.error("Live Events Error: #{e.} - #{e.backtrace}") render json: { error: "Live Events Error: #{e.}" }, status: 422 end |