class SolidusWebhooks::Configuration

Public Class Methods

new() click to toggle source
# File lib/solidus_webhooks/configuration.rb, line 7
def initialize
  @handlers = {}
end

Public Instance Methods

find_webhook_handler(id) click to toggle source
# File lib/solidus_webhooks/configuration.rb, line 20
def find_webhook_handler(id)
  @handlers[id.to_sym]
end
register_webhook_handler(id, handler) click to toggle source
# File lib/solidus_webhooks/configuration.rb, line 11
def register_webhook_handler(id, handler)
  unless handler.respond_to? :call
    raise SolidusWebhooks::InvalidHandler,
      "Please provide a handler that responds to #call, got: #{handler.inspect}"
  end

  @handlers[id.to_sym] = handler
end