class Lucid::Shopify::WebhookList
Public Class Methods
new()
click to toggle source
# File lib/lucid/shopify/webhook_list.rb, line 8 def initialize @webhooks = [] end
Public Instance Methods
each(&block)
click to toggle source
@yield [Hash]
# File lib/lucid/shopify/webhook_list.rb, line 13 def each(&block) @webhooks.each(&block) end
register(topic, fields: nil)
click to toggle source
@param topic [String] @param fields [String] e.g. 'id,tags'
# File lib/lucid/shopify/webhook_list.rb, line 19 def register(topic, fields: nil) @webhooks << {}.tap do |webhook| webhook[:topic] = topic webhook[:fields] = fields if fields end nil end