Module: OzonApi
- Defined in:
- lib/ozon_api.rb,
lib/ozon_api/client.rb,
lib/ozon_api/version.rb,
lib/ozon_api/cart_service.rb,
lib/ozon_api/item_service.rb,
lib/ozon_api/configuration.rb,
lib/ozon_api/order_service.rb,
lib/ozon_api/client_service.rb,
lib/ozon_api/detail_service.rb,
lib/ozon_api/address_service.rb,
lib/ozon_api/checkout_service.rb
Defined Under Namespace
Classes: AddressService, CartService, CheckoutService, Client, ClientService, Configuration, DetailService, ItemService, OrderService
Constant Summary
collapse
- InvalidConfigurationError =
Class.new(StandardError)
- VERSION =
'0.2.0'
Class Method Summary
collapse
Class Method Details
.address_service ⇒ Object
58
59
60
|
# File 'lib/ozon_api.rb', line 58
def self.address_service
@address_service ||= OzonApi::AddressService.new(client)
end
|
.cart_service ⇒ Object
46
47
48
|
# File 'lib/ozon_api.rb', line 46
def self.cart_service
@cart_service ||= OzonApi::CartService.new(client)
end
|
.checkout_service ⇒ Object
50
51
52
|
# File 'lib/ozon_api.rb', line 50
def self.checkout_service
@checkout_service ||= OzonApi::CheckoutService.new(client)
end
|
.client ⇒ Object
30
31
32
|
# File 'lib/ozon_api.rb', line 30
def self.client
@client ||= OzonApi::Client.new(@config)
end
|
.client_service ⇒ Object
42
43
44
|
# File 'lib/ozon_api.rb', line 42
def self.client_service
@client_service ||= OzonApi::ClientService.new(client)
end
|
.detail_service ⇒ Object
38
39
40
|
# File 'lib/ozon_api.rb', line 38
def self.detail_service
@detail_service ||= OzonApi::DetailService.new(client)
end
|
.item_service ⇒ Object
34
35
36
|
# File 'lib/ozon_api.rb', line 34
def self.item_service
@item_service ||= OzonApi::ItemService.new(client)
end
|
.order_service ⇒ Object
54
55
56
|
# File 'lib/ozon_api.rb', line 54
def self.order_service
@order_service ||= OzonApi::OrderService.new(client)
end
|
.reset ⇒ Object
26
27
28
|
# File 'lib/ozon_api.rb', line 26
def self.reset
@config = nil
end
|
.setup(&blk) ⇒ Object
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/ozon_api.rb', line 15
def self.setup(&blk)
@config ||= OzonApi::Configuration.new(&blk)
if @config.invalid?
msg = "OzonApi configuration ERROR:\n"
raise InvalidConfigurationError, msg + @config.errors.full_messages.join("\n")
end
@config
end
|