module LucidShopify

Constants

Container
Error

Subclass this class for all gem exceptions, so that callers may r escue any subclass with:

rescue LucidShopify::Error => e
VERSION

Public Class Methods

config() click to toggle source

@return [Config]

# File lib/lucid_shopify/config.rb, line 36
def config
  @config ||= configure
end
configure(options = {}) click to toggle source

@param options [Hash]

@return [Config]

# File lib/lucid_shopify/config.rb, line 15
def configure(options = {})
  @config = Config.new(
    **@config.to_h.compact,
    **options,
  )
end
configure_from_file(path = 'config/shopify.rb') click to toggle source

@param path [String]

@return [Config]

# File lib/lucid_shopify/config.rb, line 27
def configure_from_file(path = 'config/shopify.rb')
  options = LucidUtils::ConfigFromFile.new.(path, env_prefix: 'shopify')

  configure(options)
end
handlers() click to toggle source

Handlers for webhook topics.

@return [WebhookHandlerList]

@example

LucidShopify.handlers.register('orders/create', OrdersCreateWebhook.new)

@example Call topic handlers

webhook = Webhook.new(myshopify_domain, topic, data)

LucidShopify.handlers.delegate(webhook)
# File lib/lucid_shopify.rb, line 67
def handlers
  @handlers ||= WebhookHandlerList.new
end
webhooks() click to toggle source

Webhooks created for each shop.

@return [WebhookList]

@example

LucidShopify.webhooks.register('orders/create', fields: 'id,tags')
# File lib/lucid_shopify.rb, line 50
def webhooks
  @webhooks ||= WebhookList.new
end