Class: LucidShopify::CreateWebhook
- Inherits:
-
Object
- Object
- LucidShopify::CreateWebhook
- Defined in:
- lib/lucid_shopify/create_webhook.rb
Instance Method Summary collapse
-
#call(credentials, webhook) ⇒ Hash
Response data.
-
#initialize(client: Container[:client]) ⇒ CreateWebhook
constructor
A new instance of CreateWebhook.
Constructor Details
#initialize(client: Container[:client]) ⇒ CreateWebhook
Returns a new instance of CreateWebhook.
10 11 12 |
# File 'lib/lucid_shopify/create_webhook.rb', line 10 def initialize(client: Container[:client]) @client = client end |
Instance Method Details
#call(credentials, webhook) ⇒ Hash
Returns response data.
20 21 22 23 24 |
# File 'lib/lucid_shopify/create_webhook.rb', line 20 def call(credentials, webhook) data = {**webhook, address: LucidShopify.config.webhook_uri} @client.post_json(credentials, 'webhooks', webhook: data) end |