Class: TxghServer::Webhooks::Github::RequestHandler

Inherits:
TxghServer::Webhooks::Git::RequestHandler show all
Defined in:
lib/txgh-server/webhooks/github/request_handler.rb

Instance Attribute Summary

Attributes inherited from TxghServer::Webhooks::Git::RequestHandler

#logger, #request

Instance Method Summary collapse

Methods inherited from TxghServer::Webhooks::Git::RequestHandler

handle_request, #initialize

Constructor Details

This class inherits a constructor from TxghServer::Webhooks::Git::RequestHandler

Instance Method Details

#handle_requestObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/txgh-server/webhooks/github/request_handler.rb', line 7

def handle_request
  handle_safely do
    case github_event
      when 'push'
        PushHandler.new(project, repo, logger, attributes).execute
      when 'delete'
        DeleteHandler.new(project, repo, logger, attributes).execute
      when 'ping'
        PingHandler.new(logger).execute
      else
        respond_with_error(400, 'Unexpected event type')
    end
  end
end