Module: ShopifyClient

Extended by:
Dry::Configurable
Defined in:
lib/shopify-client.rb,
lib/shopify-client/error.rb,
lib/shopify-client/client.rb,
lib/shopify-client/struct.rb,
lib/shopify-client/request.rb,
lib/shopify-client/version.rb,
lib/shopify-client/webhook.rb,
lib/shopify-client/response.rb,
lib/shopify-client/cache/store.rb,
lib/shopify-client/bulk_request.rb,
lib/shopify-client/config_error.rb,
lib/shopify-client/webhook_list.rb,
lib/shopify-client/resource/base.rb,
lib/shopify-client/resource/read.rb,
lib/shopify-client/cached_request.rb,
lib/shopify-client/client/logging.rb,
lib/shopify-client/create_webhook.rb,
lib/shopify-client/delete_webhook.rb,
lib/shopify-client/verify_request.rb,
lib/shopify-client/verify_webhook.rb,
lib/shopify-client/resource/create.rb,
lib/shopify-client/resource/delete.rb,
lib/shopify-client/resource/update.rb,
lib/shopify-client/response_errors.rb,
lib/shopify-client/cache/redis_store.rb,
lib/shopify-client/parse_link_header.rb,
lib/shopify-client/create_all_webhooks.rb,
lib/shopify-client/delete_all_webhooks.rb,
lib/shopify-client/throttling/strategy.rb,
lib/shopify-client/response_user_errors.rb,
lib/shopify-client/client/normalise_path.rb,
lib/shopify-client/cookieless/middleware.rb,
lib/shopify-client/cookieless/check_header.rb,
lib/shopify-client/cache/thread_local_store.rb,
lib/shopify-client/throttling/redis_strategy.rb,
lib/shopify-client/cookieless/decode_session_token.rb,
lib/shopify-client/throttling/thread_local_strategy.rb

Defined Under Namespace

Modules: Cache, Cookieless, Resource, Throttling Classes: BulkRequest, CachedRequest, Client, CreateAllWebhooks, CreateWebhook, DeleteAllWebhooks, DeleteWebhook, ParseLinkHeader, Request, Response, ResponseErrors, ResponseUserErrors, Struct, VerifyRequest, VerifyWebhook, Webhook, WebhookList

Constant Summary collapse

Error =

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

rescue ShopifyClient::Error => e
Class.new(StandardError)
VERSION =
'0.0.7'
ConfigError =
Class.new(Error)

Class Method Summary collapse

Class Method Details

.assert_api_version!(version) ⇒ Object

Parameters:

  • version (String)

Raises:

  • (RuntimeError)


32
33
34
# File 'lib/shopify-client.rb', line 32

def assert_api_version!(version)
  raise "requires API version >= #{version}" if config.api_version < version
end

.webhooksWebhookList

Examples:

Register webhook handlers

ShopifyClient.webhooks.register('orders/create', OrdersCreateWebhook.new, fields: %w[id tags])

Call handlers for a topic

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

ShopifyClient.webhooks.delegate(webhook)

Returns:



45
46
47
# File 'lib/shopify-client.rb', line 45

def webhooks
  @webhooks ||= WebhookList.new
end