Class: Hubstats::EventsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/hubstats/events_controller.rb

Instance Method Summary collapse

Instance Method Details

#handlerObject

Public - Verifies that the request we’re receiving is a new event, and then will handle it and route it to the correct place.

request - the request of the new event

Returns - nothing, but makes a new event



12
13
14
15
16
17
18
19
20
21
22
# File 'app/controllers/hubstats/events_controller.rb', line 12

def handler
  verify_signature(request)
  kind = request.headers['X-Github-Event']
  event = event_params.with_indifferent_access
  raw_parameters = request.request_parameters
  event[:github_action] = raw_parameters["action"]
  eventsHandler = Hubstats::EventsHandler.new()
  eventsHandler.route(event, kind)

  render :nothing => true
end