Class: JiraCache::WebhookApp

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/jira_cache/webhook_app.rb

Overview

A Sinatra::Base application to process JIRA webhooks.

Defines 2 routes:

- GET /: provides a basic JSON status,
- POST /: which processes a webhook.

Instance Method Summary collapse

Instance Method Details

#clientObject

Returns the client (‘JiraCache::Client`) defined on the class (see `JiraCache.webhook_app(…)`).



43
44
45
# File 'lib/jira_cache/webhook_app.rb', line 43

def client
  self.class.client
end

#default_responseObject



47
48
49
50
51
52
53
# File 'lib/jira_cache/webhook_app.rb', line 47

def default_response
  {
    app: "jira_cache/webhook_app",
    status: "ok",
    client: client.info
  }.to_json
end