moysklad 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/rspec.yml +29 -0
- data/lib/moysklad/client.rb +9 -4
- data/lib/moysklad/entities/assortment.rb +0 -2
- data/lib/moysklad/entities/attribute.rb +0 -3
- data/lib/moysklad/entities/attribute_metadata.rb +0 -2
- data/lib/moysklad/entities/attribute_value.rb +3 -4
- data/lib/moysklad/entities/characteristic.rb +0 -2
- data/lib/moysklad/entities/characteristic_metadata.rb +0 -2
- data/lib/moysklad/entities/collection.rb +0 -3
- data/lib/moysklad/entities/company_settings_metadata.rb +0 -2
- data/lib/moysklad/entities/consignment.rb +0 -3
- data/lib/moysklad/entities/context.rb +0 -2
- data/lib/moysklad/entities/counterparty.rb +4 -2
- data/lib/moysklad/entities/country.rb +2 -8
- data/lib/moysklad/entities/currency.rb +0 -2
- data/lib/moysklad/entities/custom_entity.rb +0 -3
- data/lib/moysklad/entities/customer_order.rb +0 -7
- data/lib/moysklad/entities/customer_order_position.rb +0 -4
- data/lib/moysklad/entities/employee.rb +0 -2
- data/lib/moysklad/entities/entity.rb +0 -3
- data/lib/moysklad/entities/group.rb +5 -2
- data/lib/moysklad/entities/image.rb +0 -1
- data/lib/moysklad/entities/meta.rb +0 -2
- data/lib/moysklad/entities/organization.rb +0 -2
- data/lib/moysklad/entities/price.rb +0 -1
- data/lib/moysklad/entities/price_type.rb +0 -2
- data/lib/moysklad/entities/product.rb +0 -7
- data/lib/moysklad/entities/productfolder.rb +0 -2
- data/lib/moysklad/entities/rate.rb +0 -3
- data/lib/moysklad/entities/resource_metadata.rb +0 -5
- data/lib/moysklad/entities/service.rb +5 -10
- data/lib/moysklad/entities/shortcut.rb +0 -2
- data/lib/moysklad/entities/store.rb +0 -1
- data/lib/moysklad/entities/uom.rb +0 -2
- data/lib/moysklad/entities/variant.rb +0 -4
- data/lib/moysklad/entities.rb +42 -35
- data/lib/moysklad/resources/assortments.rb +0 -1
- data/lib/moysklad/resources/base.rb +4 -3
- data/lib/moysklad/resources/custom_entities.rb +3 -1
- data/lib/moysklad/resources/custom_entity_metadata.rb +1 -1
- data/lib/moysklad/resources/embedded_entity_metadata.rb +2 -2
- data/lib/moysklad/resources/indexed.rb +1 -5
- data/lib/moysklad/resources/positions.rb +15 -0
- data/lib/moysklad/resources/stock.rb +1 -1
- data/lib/moysklad/resources/subresource.rb +0 -1
- data/lib/moysklad/resources.rb +22 -9
- data/lib/moysklad/universe.rb +1 -1
- data/lib/moysklad/version.rb +1 -1
- data/lib/moysklad.rb +11 -7
- data/moysklad.gemspec +2 -2
- data/spec/lib/moysklad/entities/customer_order_position_spec.rb +4 -17
- data/spec/lib/moysklad/entities/customer_order_spec.rb +7 -37
- data/spec/lib/moysklad/resources/base_spec.rb +0 -54
- data/spec/lib/moysklad/resources_spec.rb +0 -2
- data/spec/lib/moysklad/universe_spec.rb +0 -23
- data/spec/lib/moysklad_spec.rb +0 -1
- data/spec/support/resource.rb +1 -66
- metadata +10 -146
- data/.travis.yml +0 -5
- data/lib/moysklad/entities/attachment_document.rb +0 -16
- data/lib/moysklad/entities/barcode.rb +0 -19
- data/lib/moysklad/entities/common_object.rb +0 -27
- data/lib/moysklad/entities/company.rb +0 -20
- data/lib/moysklad/entities/company_concern.rb +0 -20
- data/lib/moysklad/entities/contact.rb +0 -15
- data/lib/moysklad/entities/custom_entity_metadata.rb +0 -11
- data/lib/moysklad/entities/embedded_entity_metadata.rb +0 -18
- data/lib/moysklad/entities/error.rb +0 -13
- data/lib/moysklad/entities/good_folder.rb +0 -10
- data/lib/moysklad/entities/good_ref.rb +0 -12
- data/lib/moysklad/entities/images.rb +0 -10
- data/lib/moysklad/entities/my_company.rb +0 -12
- data/lib/moysklad/entities/sale_price.rb +0 -18
- data/lib/moysklad/entities/sale_prices.rb +0 -10
- data/lib/moysklad/entities/slot.rb +0 -10
- data/lib/moysklad/entities/workflow.rb +0 -11
- data/lib/moysklad/entities/workflow_state.rb +0 -8
- data/spec/fixtures/302.raw +0 -15
- data/spec/fixtures/400.raw +0 -8
- data/spec/fixtures/401.html +0 -1
- data/spec/fixtures/401_2.html +0 -1
- data/spec/fixtures/405.raw +0 -9
- data/spec/fixtures/500.raw +0 -8
- data/spec/fixtures/502.raw +0 -8
- data/spec/fixtures/Consignment_list_0.raw +0 -14
- data/spec/fixtures/Consignment_list_1000.raw +0 -14
- data/spec/fixtures/Country_list.raw +0 -14
- data/spec/fixtures/CustomEntityMetadata_list.raw +0 -14
- data/spec/fixtures/CustomEntity_list.raw +0 -14
- data/spec/fixtures/CustomEntity_list_bad_chars.raw +0 -17
- data/spec/fixtures/EmbeddedEntityMetadata_list.raw +0 -15
- data/spec/fixtures/Feature_list.raw +0 -14
- data/spec/fixtures/Feature_list_1000.raw +0 -14
- data/spec/fixtures/Good_WithManyAttributes.raw +0 -13
- data/spec/fixtures/Good_e932ebe1-2e22-11e4-9406-002590a28eca.raw +0 -12
- data/spec/fixtures/Good_eb77ad57-2e22-11e4-4030-002590a28eca.raw +0 -12
- data/spec/fixtures/Goods_list.raw +0 -14
- data/spec/fixtures/Metadata_list.raw +0 -14
- data/spec/fixtures/PriceType_list.raw +0 -14
- data/spec/fixtures/Stock.raw +0 -11
- data/spec/fixtures/Stock_showConsignments.raw +0 -11
- data/spec/fixtures/Uom_list.raw +0 -14
- data/spec/fixtures/Warehouse_list.raw +0 -14
- data/spec/fixtures/Workflow_list.raw +0 -15
- data/spec/fixtures/attribute_boolean.xml +0 -6
- data/spec/fixtures/attribute_dictionary.xml +0 -5
- data/spec/fixtures/attribute_double.xml +0 -6
- data/spec/fixtures/attribute_file.xml +0 -12
- data/spec/fixtures/attribute_long.xml +0 -6
- data/spec/fixtures/attribute_text.xml +0 -5
- data/spec/fixtures/attribute_time.xml +0 -6
- data/spec/fixtures/attribute_url.xml +0 -6
- data/spec/fixtures/bad_chars.xml +0 -6
- data/spec/fixtures/customer_order.xml +0 -28
- data/spec/fixtures/good_with_attributes.raw +0 -12
- data/spec/fixtures/good_with_image.xml +0 -39
- data/spec/fixtures/resource_forbidden.raw +0 -9
- data/spec/fixtures/wrong_password.raw +0 -9
- data/spec/fixtures/wrong_type.raw +0 -70
- data/spec/fixtures/wrong_user.raw +0 -9
- data/spec/lib/moysklad/client/errors_spec.rb +0 -102
- data/spec/lib/moysklad/entities/attribute_metadata_spec.rb +0 -30
- data/spec/lib/moysklad/entities/attribute_spec.rb +0 -36
- data/spec/lib/moysklad/entities/country_spec.rb +0 -25
- data/spec/lib/moysklad/entities/custom_entity_metadata_spec.rb +0 -34
- data/spec/lib/moysklad/entities/custom_entity_spec.rb +0 -34
- data/spec/lib/moysklad/entities/good_spec.rb +0 -55
- data/spec/lib/moysklad/resources/countries_spec.rb +0 -22
- data/spec/lib/moysklad/resources/custom_entity_metadata_spec.rb +0 -13
- data/spec/lib/moysklad/resources/embedded_entity_metadata_indexed_spec.rb +0 -20
- data/spec/lib/moysklad/resources/embedded_entity_metadata_spec.rb +0 -11
- data/spec/lib/moysklad/resources/good_folders_spec.rb +0 -17
- data/spec/lib/moysklad/resources/indexed_spec.rb +0 -61
- data/spec/lib/moysklad/resources/stock_spec.rb +0 -63
- data/spec/lib/moysklad/resources/warehouses_spec.rb +0 -20
- data/spec/lib/moysklad/resources/workflows_spec.rb +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: abdc083d3dbc4b8020ce96a71f348d4da052c9a9a85ff66acb1b5c16e3ba1a89
|
4
|
+
data.tar.gz: e925e1cd59dda2dffa9cb16b855989ed35901239ca1e56d08ae9c6d9d4db8bb8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10c0597144a06f4c3b243c3f8309a2ae1d241dfbe575280a9dd1d9144c4040a29441229ba392c6ddf51bbb52916f414dbdb14822c5ac22270fed77061f05a966
|
7
|
+
data.tar.gz: 6d374cfec6e3985bad837f7d82a26d50cc9436c3a5f6f5b54c3fe940fa75337f9743e176d70d0e5db1281cffa9a7a0d3e6a3fefbe1e373853a2c5b776b80fbc0
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Rspec
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
runs-on: ubuntu-latest
|
19
|
+
steps:
|
20
|
+
- name: Checkout repository and submodules
|
21
|
+
uses: actions/checkout@v2
|
22
|
+
with:
|
23
|
+
submodules: recursive
|
24
|
+
- name: Set up Ruby
|
25
|
+
uses: ruby/setup-ruby@v1
|
26
|
+
with:
|
27
|
+
ruby-version: 3.1.4
|
28
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
29
|
+
- run: bundle exec rspec
|
data/lib/moysklad/client.rb
CHANGED
@@ -8,8 +8,13 @@ class Moysklad::Client
|
|
8
8
|
URL ='https://online.moysklad.ru/api/remap/1.1/'
|
9
9
|
|
10
10
|
def initialize login: nil, password: nil
|
11
|
-
@client = Faraday.new URL
|
12
|
-
|
11
|
+
@client = Faraday.new URL do |conn|
|
12
|
+
if Faraday::VERSION.split('.').first.to_i < 2
|
13
|
+
conn.request(:basic_auth, login, password)
|
14
|
+
else
|
15
|
+
conn.request(:authorization, :basic, login, password)
|
16
|
+
end
|
17
|
+
end
|
13
18
|
end
|
14
19
|
|
15
20
|
def download(path, filename)
|
@@ -28,7 +33,6 @@ class Moysklad::Client
|
|
28
33
|
req.url path
|
29
34
|
req.headers['Content-Type'] = 'application/json'
|
30
35
|
req.headers['Accept'] = '*/*'
|
31
|
-
puts data
|
32
36
|
req.body = data
|
33
37
|
end
|
34
38
|
parse_response result
|
@@ -64,8 +68,9 @@ class Moysklad::Client
|
|
64
68
|
end
|
65
69
|
|
66
70
|
def parse_response res
|
71
|
+
Moysklad.logger.debug "Response [#{res.status}]: #{res.body}"
|
72
|
+
|
67
73
|
if res.status == 200
|
68
|
-
Moysklad.logger.info "Response: #{res.body}"
|
69
74
|
return if res.body.blank?
|
70
75
|
JSON.parse res.body
|
71
76
|
else
|
@@ -1,11 +1,10 @@
|
|
1
|
-
require_relative 'custom_entity'
|
2
|
-
|
3
1
|
module Moysklad::Entities
|
4
2
|
class AttributeValue < Virtus::Attribute
|
5
3
|
def coerce(value)
|
6
|
-
|
4
|
+
case value
|
5
|
+
when String, Float
|
7
6
|
value
|
8
|
-
|
7
|
+
when ::Hash
|
9
8
|
if value['meta']['type'] == 'customentity'
|
10
9
|
CustomEntity.new value
|
11
10
|
else
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require_relative 'entity'
|
2
|
-
|
3
1
|
module Moysklad::Entities
|
4
2
|
class Counterparty < Entity
|
5
3
|
attribute :email, String
|
@@ -14,5 +12,9 @@ module Moysklad::Entities
|
|
14
12
|
attribute :kpp, String
|
15
13
|
attribute :ogrn, String
|
16
14
|
attribute :okpo, String
|
15
|
+
|
16
|
+
attribute :description, String
|
17
|
+
|
18
|
+
attribute :syncid, String
|
17
19
|
end
|
18
20
|
end
|
@@ -1,10 +1,3 @@
|
|
1
|
-
require_relative 'entity'
|
2
|
-
require_relative 'owner'
|
3
|
-
require_relative 'group'
|
4
|
-
require_relative 'rate'
|
5
|
-
require_relative 'customer_order_position'
|
6
|
-
require_relative 'time'
|
7
|
-
|
8
1
|
module Moysklad::Entities
|
9
2
|
# Пример:
|
10
3
|
# https://online.moysklad.ru/api/remap/1.1/doc/index.html#документ-заказ-покупателя
|
@@ -1,10 +1,3 @@
|
|
1
|
-
require_relative 'currency'
|
2
|
-
require_relative 'productfolder'
|
3
|
-
require_relative 'uom'
|
4
|
-
require_relative 'entity'
|
5
|
-
require_relative 'attribute_metadata'
|
6
|
-
require_relative 'image'
|
7
|
-
|
8
1
|
module Moysklad::Entities
|
9
2
|
class Product < Entity
|
10
3
|
attribute :accountId, String
|
@@ -1,9 +1,3 @@
|
|
1
|
-
require_relative 'entity'
|
2
|
-
require_relative 'uom'
|
3
|
-
require_relative 'owner'
|
4
|
-
require_relative 'group'
|
5
|
-
require_relative 'price'
|
6
|
-
|
7
1
|
module Moysklad::Entities
|
8
2
|
class Service < Entity
|
9
3
|
attribute :accountId, String
|
@@ -13,6 +7,7 @@ module Moysklad::Entities
|
|
13
7
|
attribute :effectiveVat, Float
|
14
8
|
attribute :pathName, String
|
15
9
|
attribute :productFolder, Productfolder
|
10
|
+
attribute :description, String
|
16
11
|
|
17
12
|
attribute :uom, Uom
|
18
13
|
|
@@ -20,9 +15,9 @@ module Moysklad::Entities
|
|
20
15
|
attribute :salePrices, Array[Price]
|
21
16
|
|
22
17
|
# Когда загружаем через ассортименты эти поля устанавливаются
|
23
|
-
attribute :stock, Float
|
24
|
-
attribute :reserve, Float
|
25
|
-
attribute :inTransit, Float
|
26
|
-
attribute :quantity, Float
|
18
|
+
# attribute :stock, Float
|
19
|
+
# attribute :reserve, Float
|
20
|
+
# attribute :inTransit, Float
|
21
|
+
# attribute :quantity, Float
|
27
22
|
end
|
28
23
|
end
|
data/lib/moysklad/entities.rb
CHANGED
@@ -1,42 +1,49 @@
|
|
1
1
|
module Moysklad
|
2
2
|
module Entities
|
3
|
-
extend ActiveSupport::Autoload
|
4
3
|
%w{
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
4
|
+
base
|
5
|
+
meta
|
6
|
+
entity
|
7
|
+
country
|
8
|
+
assortment
|
9
|
+
attribute_value
|
10
|
+
attribute
|
11
|
+
attribute_metadata
|
12
|
+
owner
|
13
|
+
group
|
14
|
+
productfolder
|
15
|
+
uom
|
16
|
+
currency
|
17
|
+
price
|
18
|
+
image
|
19
|
+
employee
|
20
|
+
context
|
21
|
+
product
|
22
|
+
bundle
|
23
|
+
characteristic
|
24
|
+
characteristic_metadata
|
25
|
+
collection_meta
|
26
|
+
collection
|
27
|
+
company_settings_metadata
|
28
|
+
consignment
|
29
|
+
contract
|
30
|
+
counterparty
|
31
|
+
custom_entity
|
32
|
+
rate
|
33
|
+
customer_order
|
34
|
+
customer_order_position
|
35
|
+
organization
|
36
|
+
page
|
37
|
+
price_type
|
38
|
+
rate
|
39
|
+
resource_metadata
|
40
|
+
service
|
41
|
+
shortcut
|
42
|
+
store
|
43
|
+
time
|
44
|
+
variant
|
38
45
|
}.each do |m|
|
39
|
-
|
46
|
+
require_relative "entities/#{m}"
|
40
47
|
end
|
41
48
|
end
|
42
49
|
end
|
@@ -1,5 +1,6 @@
|
|
1
|
-
require 'json'
|
2
1
|
class Moysklad::Resources::Base
|
2
|
+
include Moysklad::Resources::Positions
|
3
|
+
|
3
4
|
PREFIX_PATH = 'entity/'
|
4
5
|
|
5
6
|
def self.inherited superclass
|
@@ -10,8 +11,8 @@ class Moysklad::Resources::Base
|
|
10
11
|
# Возвращает этот-же ресурс только индексированный
|
11
12
|
#
|
12
13
|
# @return [Moysklad::Resources::Indexed]
|
13
|
-
def self.indexed
|
14
|
-
Moysklad::Resources::Indexed.new new(
|
14
|
+
def self.indexed client: nil, list_path: nil
|
15
|
+
Moysklad::Resources::Indexed.new new(client: client, list_path: list_path)
|
15
16
|
end
|
16
17
|
|
17
18
|
# https://support.moysklad.ru/hc/ru/articles/203404253-REST-сервис-синхронизации-данных
|
@@ -2,7 +2,9 @@ module Moysklad::Resources
|
|
2
2
|
# Элементы словаря
|
3
3
|
class CustomEntities < Base
|
4
4
|
# custom_entity_meta_id - id словаря, элементы которого хотим получить
|
5
|
-
def initialize
|
5
|
+
def initialize(custom_entity_meta_id: nil, client: nil, list_path: nil)
|
6
|
+
raise 'Client empty' if client.nil? # support ruby 2.0.0
|
7
|
+
|
6
8
|
@custom_entity_meta_id = custom_entity_meta_id
|
7
9
|
super client: client, list_path: list_path
|
8
10
|
end
|
@@ -12,8 +12,8 @@ module Moysklad::Resources
|
|
12
12
|
:embedded_entity_metadata
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.indexed
|
16
|
-
Moysklad::Resources::EmbeddedEntityMetadataIndexed.new new(
|
15
|
+
def self.indexed client: nil, list_path: nil
|
16
|
+
Moysklad::Resources::EmbeddedEntityMetadataIndexed.new new(client: client, list_path: list_path)
|
17
17
|
end
|
18
18
|
end
|
19
19
|
end
|
@@ -1,7 +1,3 @@
|
|
1
|
-
require_relative 'where_filter'
|
2
|
-
require_relative 'load_all'
|
3
|
-
require_relative 'indexed_cache'
|
4
|
-
|
5
1
|
module Moysklad::Resources
|
6
2
|
class Indexed < SimpleDelegator
|
7
3
|
WrongEntriesCountError = Class.new StandardError
|
@@ -58,7 +54,7 @@ module Moysklad::Resources
|
|
58
54
|
cached_index
|
59
55
|
end
|
60
56
|
|
61
|
-
def pull_list(params)
|
57
|
+
def pull_list(params={})
|
62
58
|
load_all(params)
|
63
59
|
end
|
64
60
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# API сервиса МойСклад позволяет оперировать с такими документами как Отгрузка, Заказ покупателя, Счёт покупателю, Розничная продажа.
|
2
|
+
# Перечисленные документы содержат позиции, работать с которыми можно как в составе отдельного документа, так и с помощью специальных ресурсов для управления позициями документа.
|
3
|
+
|
4
|
+
module Moysklad::Resources::Positions
|
5
|
+
# Создаем позицию документа по uuid
|
6
|
+
#
|
7
|
+
# @return [Moysklad::Entities::Base]
|
8
|
+
def create_position model_uuid, position
|
9
|
+
position.class.build client.post(create_position_path(model_uuid), position.to_json)
|
10
|
+
end
|
11
|
+
|
12
|
+
def create_position_path(model_uuid)
|
13
|
+
[prefix_path, model_uuid, 'positions'].join('/')
|
14
|
+
end
|
15
|
+
end
|
data/lib/moysklad/resources.rb
CHANGED
@@ -1,26 +1,39 @@
|
|
1
1
|
module Moysklad::Resources
|
2
2
|
mattr_accessor :resources
|
3
3
|
|
4
|
-
extend ActiveSupport::Autoload
|
5
|
-
|
6
4
|
def self.register_resource resource_class
|
7
5
|
self.resources ||= []
|
8
6
|
self.resources << resource_class
|
9
7
|
end
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
%w{
|
10
|
+
positions
|
11
|
+
base
|
12
|
+
load_all
|
13
|
+
assortments
|
14
|
+
custom_entities
|
15
|
+
custom_entity_metadata
|
16
|
+
embedded_entity_metadata
|
17
|
+
where_filter
|
18
|
+
indexed_cache
|
19
|
+
indexed
|
20
|
+
embedded_entity_metadata_indexed
|
21
|
+
products
|
22
|
+
stock
|
23
|
+
subresource
|
24
|
+
}.each do |m|
|
25
|
+
require_relative "resources/#{m}"
|
26
|
+
end
|
15
27
|
|
16
28
|
# Простые ресурсы, которые создаются автоматически
|
17
|
-
%w{
|
29
|
+
%w{Productfolders Uoms PriceType Countries Variants
|
18
30
|
Counterparty
|
19
31
|
Organization
|
32
|
+
Service
|
33
|
+
Bundle
|
20
34
|
CustomerOrders Store
|
21
35
|
Currency
|
22
|
-
|
23
|
-
Companies Consignments MyCompanies}.each do |klass_name|
|
36
|
+
Consignments Group}.each do |klass_name|
|
24
37
|
const_set klass_name, Class.new( Base )
|
25
38
|
end
|
26
39
|
end
|
data/lib/moysklad/universe.rb
CHANGED
@@ -40,7 +40,7 @@ module Moysklad
|
|
40
40
|
Moysklad::Resources.resources.each do |resource_klass|
|
41
41
|
@@resources_list << resource_klass.pluralized_type.to_sym
|
42
42
|
define_method resource_klass.pluralized_type do |opts={}|
|
43
|
-
@resources[resource_klass.type] ||= resource_klass.indexed( opts.merge
|
43
|
+
@resources[resource_klass.type] ||= resource_klass.indexed( **opts.merge(client: client) )
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
data/lib/moysklad/version.rb
CHANGED