Class: Contentful::Webhook::Listener::WebhookFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/contentful/webhook/listener/webhooks.rb

Instance Method Summary collapse

Constructor Details

#initialize(request) ⇒ WebhookFactory

Returns a new instance of WebhookFactory.



12
13
14
15
16
# File 'lib/contentful/webhook/listener/webhooks.rb', line 12

def initialize(request)
  @headers = {}
  request.each { |header, value| @headers[header] = value }
  @body = JSON.load(request.body)
end

Instance Method Details

#createObject



18
19
20
# File 'lib/contentful/webhook/listener/webhooks.rb', line 18

def create
  webhook_class.new(@headers, @body)
end