Class: Contentful::Webhook::Listener::WebhookFactory
- Inherits:
-
Object
- Object
- Contentful::Webhook::Listener::WebhookFactory
- Defined in:
- lib/contentful/webhook/listener/webhooks.rb
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(request) ⇒ WebhookFactory
constructor
A new instance of WebhookFactory.
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
#create ⇒ Object
18 19 20 |
# File 'lib/contentful/webhook/listener/webhooks.rb', line 18 def create webhook_class.new(@headers, @body) end |