Module: EcwidApi

Defined in:
lib/ecwid_api.rb,
lib/ecwid_api/error.rb,
lib/ecwid_api/client.rb,
lib/ecwid_api/entity.rb,
lib/ecwid_api/version.rb,
lib/ecwid_api/category.rb,
lib/ecwid_api/category_api.rb

Overview

Public: This is the main namespace for the EcwidApi. It can be used to store the default client.

Defined Under Namespace

Classes: Category, CategoryApi, Client, Entity, Error

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.default_client(&block) ⇒ Object

Public: Gets and configures a default client

To configure the default client, just pass a block.

Examples

EcwidApi.default_client do |config|
  config.store_id = '12345'
  config.order_secret_key = 'ORDER_SECRET_KEY'
  config.product_secret_key = 'PRODUCT_SECRET_KEY'
end

client = EcwidApi.default_client.store_id
# => "12345"

Returns an EcwidApi::Client, or null if one hasn’t been configured



32
33
34
35
36
37
# File 'lib/ecwid_api.rb', line 32

def default_client(&block)
  if block_given?
    @default_client = Client.new(&block)
  end
  @default_client
end