Class: Lucid::Shopify::CreateAllWebhooks
- Inherits:
-
Object
- Object
- Lucid::Shopify::CreateAllWebhooks
- Defined in:
- lib/lucid/shopify/create_all_webhooks.rb
Instance Method Summary collapse
-
#call(credentials, webhooks: Container[:webhook_list]) ⇒ Array<Hash>
Create all webhooks for the shop.
-
#initialize(create_webhook: Container[:create_webhook]) ⇒ CreateAllWebhooks
constructor
A new instance of CreateAllWebhooks.
Constructor Details
#initialize(create_webhook: Container[:create_webhook]) ⇒ CreateAllWebhooks
Returns a new instance of CreateAllWebhooks.
9 10 11 |
# File 'lib/lucid/shopify/create_all_webhooks.rb', line 9 def initialize(create_webhook: Container[:create_webhook]) @create_webhook = create_webhook end |
Instance Method Details
#call(credentials, webhooks: Container[:webhook_list]) ⇒ Array<Hash>
Create all webhooks for the shop.
19 20 21 22 23 |
# File 'lib/lucid/shopify/create_all_webhooks.rb', line 19 def call(credentials, webhooks: Container[:webhook_list]) webhooks.map do |webhook| Thread.new { @create_webhook.(credentials, webhook) } end.map(&:value) end |