class LucidShopify::CreateWebhook

Public Class Methods

new(client: Container[:client]) click to toggle source

@param client [#post_json]

# File lib/lucid_shopify/create_webhook.rb, line 10
def initialize(client: Container[:client])
  @client = client
end

Public Instance Methods

call(credentials, webhook) click to toggle source

@param credentials [Credentials] @param webhook [Hash]

@return [Hash] response data

# 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