Class: Krb::Webhooks::Base

Inherits:
ApplicationService show all
Defined in:
lib/krb/webhooks/base.rb

Overview

Webhooks methods

Direct Known Subclasses

Reset

Instance Method Summary collapse

Methods inherited from ApplicationService

process, #prompt, #setup_file_name, #setup_file_path, #verify_admin, #verify_production, #verify_setup

Constructor Details

#initializeBase

Returns a new instance of Base.



9
10
11
12
13
14
# File 'lib/krb/webhooks/base.rb', line 9

def initialize
  super
  verify_setup
  verify_production
  verify_admin
end

Instance Method Details

#processObject



16
17
18
19
20
21
# File 'lib/krb/webhooks/base.rb', line 16

def process
  ::Krb::Webhooks::Reset.process
  %w[create update delete].each do |meth|
    HTTP.headers(headers).post(shopify_webhooks_url, body: body(meth).to_json)
  end
end