laximo 0.4.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 500db415d8c7bb15169823c962202d9713ce2e3b
4
- data.tar.gz: 98058cc1d8580e420beaa073f90ac52ce49350d5
3
+ metadata.gz: 08247f7af2c6825a9b54dc0f3f1cdc04887389f9
4
+ data.tar.gz: 1dccf010d351615a04ebe75f7e68e607b1a62c33
5
5
  SHA512:
6
- metadata.gz: c3872ae2c4839fc9361511d9b44859626488673d06934fe2828fd32a5e990f192db9db35ff6001acd35d8547ef84c9fcb793d45fca0fbf2affda116c0bab2164
7
- data.tar.gz: 82469f10ae4110cb6ce08de93494ac24472a22c95e85ea6685d1237128457e3bc34a9ea0ec26f3879362abe31c97cfbe2fcf7376213dc8145d01a33e5934d944
6
+ metadata.gz: d1e1640972e8ad09d64e18f6efb1c638f5b2a20d0f5f0b439361069f8c0b6ba77482a7b0dde410c770077f2138ecf04395268a7aebace3d6ce6b2548fe70cd8a
7
+ data.tar.gz: be8d348848579683ff657bbff9269884799116494f11e2bd3af1379d70ee830a71e72ba9ebe74061b3a2eba1aa0fcd6304a52a1446a608a22e923b7f51c214e6
data/README.md CHANGED
@@ -9,7 +9,7 @@ Ruby 1.9.3+
9
9
 
10
10
  ### Установка (Rails)
11
11
  1. Добавляем в Gemfile строку:`gem 'laximo'`
12
- 2. В консоле `bundle install`
12
+ 2. В консоли `bundle install`
13
13
  3. Задаем параметры конфигурации в файле `config/initializers/laximo.rb`:
14
14
  ```ruby
15
15
  Laximo.options.use_ssl true
@@ -50,26 +50,26 @@ Laximo.options.debug false
50
50
  * `result` - возвращает массив хешей или пустой массив, если ничего не найдено, или если в процессе выполения произошла ошибка.
51
51
 
52
52
  ### Методы web-сервиса [Laximo.OEM](http://laximo.net/index.php/Laximo_Web-services:OEM:Laximo.OEM)
53
- * [Laximo.oem.list_catalogs(ssd = nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListCatalogs)
54
- * [Laximo.oem.get_catalog_info(catalog, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetCatalogInfo)
55
- * [Laximo.oem.find_vehicle_by_vin(vin, catalog: nil, ssd: nil, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByVIN)
56
- * [Laximo.oem.find_vehicle_by_frame(catalog, frame, frame_no, ssd: nil, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByFrame)
57
- * [Laximo.oem.get_wizard(catalog, wizard_id: nil, value_id: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetWizard)
58
- * [Laximo.oem.get_wizard2(catalog, ssd, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetWizard2)
59
- * [Laximo.oem.get_wizard_next_step2(catalog, ssd, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetWizardNextStep2)
60
- * [Laximo.oem.find_vehicle_by_wizard(catalog, wizard_id, ssd: nil, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByWizard)
61
- * [Laximo.oem.find_vehicle_by_wizard2(catalog, ssd, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByWizard2)
62
- * [Laximo.oem.get_vehicle_info(catalog, vehicle_id, ssd, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetVehicleInfo)
63
- * [Laximo.oem.exec_custom_operation(catalog, operation, param, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ExecCustomOperation)
64
- * [Laximo.oem.list_units(catalog, vehicle_id, ssd, category_id: nil, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListUnits)
65
- * [Laximo.oem.list_categories(catalog, vehicle_id, ssd, category_id: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListCategories)
66
- * [Laximo.oem.get_filter_by_unit(catalog, unit_id, vehicle_id, filter, ssd, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetFilterByUnit)
67
- * [Laximo.oem.get_unit_info(catalog, ssd, unit_id, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetUnitInfo)
68
- * [Laximo.oem.list_detail_by_unit(catalog, ssd, unit_id, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListDetailByUnit)
69
- * [Laximo.oem.list_image_map_by_unit(catalog, ssd, unit_id)](http://laximo.net/index.php/Laximo_Web-services:OEM:ListImageMapByUnit)
70
- * [Laximo.oem.get_filter_by_detail(catalog, unit_id, detail_id, filter, ssd, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetFilterByDetail)
53
+ * [Laximo.oem.list_catalogs(ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListCatalogs)
54
+ * [Laximo.oem.get_catalog_info(catalog:, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetCatalogInfo)
55
+ * [Laximo.oem.find_vehicle_by_vin(vin:, catalog: nil, ssd: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByVIN)
56
+ * [Laximo.oem.find_vehicle_by_frame(catalog:, frame:, frame_no:, ssd: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByFrame)
57
+ * [Laximo.oem.get_wizard(catalog:, wizard_id: nil, value_id: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetWizard)
58
+ * [Laximo.oem.get_wizard2(catalog:, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetWizard2)
59
+ * [Laximo.oem.get_wizard_next_step2(catalog:, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetWizardNextStep2)
60
+ * [Laximo.oem.find_vehicle_by_wizard(catalog:, wizard_id:, ssd: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByWizard)
61
+ * [Laximo.oem.find_vehicle_by_wizard2(catalog:, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:FindVehicleByWizard2)
62
+ * [Laximo.oem.get_vehicle_info(catalog:, vehicle_id:, ssd: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetVehicleInfo)
63
+ * [Laximo.oem.exec_custom_operation(catalog:, operation:, param:, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ExecCustomOperation)
64
+ * [Laximo.oem.list_units(catalog:, vehicle_id:, ssd: nil, category_id: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListUnits)
65
+ * [Laximo.oem.list_categories(catalog:, vehicle_id:, ssd: nil, category_id: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListCategories)
66
+ * [Laximo.oem.get_filter_by_unit(catalog:, unit_id:, vehicle_id:, filter:, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetFilterByUnit)
67
+ * [Laximo.oem.get_unit_info(catalog:, unit_id:, ssd: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetUnitInfo)
68
+ * [Laximo.oem.list_detail_by_unit(catalog:, unit_id:, ssd: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListDetailByUnit)
69
+ * [Laximo.oem.list_image_map_by_unit(catalog:, unit_id:, ssd: nil)](http://laximo.net/index.php/Laximo_Web-services:OEM:ListImageMapByUnit)
70
+ * [Laximo.oem.get_filter_by_detail(catalog:, unit_id:, detail_id:, filter:, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:GetFilterByDetail)
71
71
  * [Laximo.oem.list_quick_group(catalog, vehicle_id, ssd: nil, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListQuickGroup)
72
- * [Laximo.oem.list_quick_detail(catalog, vehicle_id, quick_group_id, all, ssd: nil, localized: false, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListQuickDetail)
72
+ * [Laximo.oem.list_quick_detail(catalog:, vehicle_id:, quick_group_id:, all:, ssd: nil, localized: true, locale: 'ru_RU')](http://laximo.net/index.php/Laximo_Web-services:OEM:ListQuickDetail)
73
73
 
74
74
  Данные методы возвращают объект, у которого заданы методы:
75
75
 
@@ -113,4 +113,4 @@ res.result # []
113
113
 
114
114
  Автор: [Tyralion](mailto:piliaiev@gmail.com)
115
115
 
116
- Copyright (c) 2015 DansingBytes.ru, под лицензией BSD
116
+ Copyright (c) 2015-2016 DansingBytes.ru, под лицензией BSD
@@ -3,6 +3,15 @@ module Laximo
3
3
 
4
4
  class Am
5
5
 
6
+ DEFAULT_OPTIONS = [
7
+ :crosses,
8
+ :properties,
9
+ :names,
10
+ :weights,
11
+ :prices,
12
+ :images
13
+ ].freeze
14
+
6
15
  def initialize
7
16
 
8
17
  @request = ::Laximo::Request.new(
@@ -15,7 +24,7 @@ module Laximo
15
24
  def find_oem(
16
25
  oem,
17
26
  brand: nil,
18
- options: [],
27
+ options: DEFAULT_OPTIONS,
19
28
  locale: 'ru_RU'
20
29
  )
21
30
 
@@ -48,7 +57,7 @@ module Laximo
48
57
 
49
58
  def find_detail(
50
59
  detail_id,
51
- options: [],
60
+ options: DEFAULT_OPTIONS,
52
61
  locale: 'ru_RU'
53
62
  )
54
63
 
@@ -13,7 +13,7 @@ module Laximo
13
13
  end # initialize
14
14
 
15
15
  def list_catalogs(
16
- ssd = nil,
16
+ ssd: nil,
17
17
  locale: 'ru_RU'
18
18
  )
19
19
 
@@ -28,7 +28,7 @@ module Laximo
28
28
  end # list_catalogs
29
29
 
30
30
  def get_catalog_info(
31
- catalog,
31
+ catalog:,
32
32
  ssd: nil,
33
33
  locale: 'ru_RU'
34
34
  )
@@ -45,10 +45,10 @@ module Laximo
45
45
  end # get_catalog_info
46
46
 
47
47
  def find_vehicle_by_vin(
48
- vin,
48
+ vin:,
49
49
  catalog: nil,
50
50
  ssd: nil,
51
- localized: false,
51
+ localized: true,
52
52
  locale: 'ru_RU'
53
53
  )
54
54
 
@@ -66,11 +66,11 @@ module Laximo
66
66
  end # find_vehicle_by_vin
67
67
 
68
68
  def find_vehicle_by_frame(
69
- catalog,
70
- frame,
71
- frame_no,
69
+ catalog:,
70
+ frame:,
71
+ frame_no:,
72
72
  ssd: nil,
73
- localized: false,
73
+ localized: true,
74
74
  locale: 'ru_RU'
75
75
  )
76
76
 
@@ -90,7 +90,7 @@ module Laximo
90
90
 
91
91
  # TODO: Устаревший метод
92
92
  def get_wizard(
93
- catalog,
93
+ catalog:,
94
94
  wizard_id: nil,
95
95
  value_id: nil,
96
96
  locale: 'ru_RU'
@@ -111,8 +111,8 @@ module Laximo
111
111
  end # get_wizard
112
112
 
113
113
  def get_wizard2(
114
- catalog,
115
- ssd,
114
+ catalog:,
115
+ ssd: nil,
116
116
  locale: 'ru_RU'
117
117
  )
118
118
 
@@ -128,8 +128,8 @@ module Laximo
128
128
  end # get_wizard2
129
129
 
130
130
  def get_wizard_next_step2(
131
- catalog,
132
- ssd,
131
+ catalog:,
132
+ ssd: nil,
133
133
  locale: 'ru_RU'
134
134
  )
135
135
 
@@ -146,10 +146,10 @@ module Laximo
146
146
 
147
147
  # TODO: Устаревший метод
148
148
  def find_vehicle_by_wizard(
149
- catalog,
150
- wizard_id,
149
+ catalog:,
150
+ wizard_id: nil,
151
151
  ssd: nil,
152
- localized: false,
152
+ localized: true,
153
153
  locale: 'ru_RU'
154
154
  )
155
155
 
@@ -169,8 +169,8 @@ module Laximo
169
169
  end # find_vehicle_by_wizard
170
170
 
171
171
  def find_vehicle_by_wizard2(
172
- catalog,
173
- ssd,
172
+ catalog:,
173
+ ssd: nil,
174
174
  locale: 'ru_RU'
175
175
  )
176
176
 
@@ -186,10 +186,10 @@ module Laximo
186
186
  end # find_vehicle_by_wizard2
187
187
 
188
188
  def get_vehicle_info(
189
- catalog,
190
- vehicle_id,
191
- ssd,
192
- localized: false,
189
+ catalog:,
190
+ vehicle_id:,
191
+ ssd: nil,
192
+ localized: true,
193
193
  locale: 'ru_RU'
194
194
  )
195
195
 
@@ -207,9 +207,9 @@ module Laximo
207
207
  end # get_vehicle_info
208
208
 
209
209
  def exec_custom_operation(
210
- catalog,
211
- operation,
212
- param,
210
+ catalog:,
211
+ operation:,
212
+ param:,
213
213
  locale: 'ru_RU'
214
214
  )
215
215
 
@@ -226,11 +226,11 @@ module Laximo
226
226
  end # exec_custom_operation
227
227
 
228
228
  def list_units(
229
- catalog,
230
- vehicle_id,
231
- ssd,
229
+ catalog:,
230
+ vehicle_id:,
231
+ ssd: nil,
232
232
  category_id: -1,
233
- localized: false,
233
+ localized: true,
234
234
  locale: 'ru_RU'
235
235
  )
236
236
 
@@ -249,9 +249,9 @@ module Laximo
249
249
  end # list_units
250
250
 
251
251
  def list_categories(
252
- catalog,
253
- vehicle_id,
254
- ssd,
252
+ catalog:,
253
+ vehicle_id:,
254
+ ssd: nil,
255
255
  category_id: -1,
256
256
  locale: 'ru_RU'
257
257
  )
@@ -270,11 +270,11 @@ module Laximo
270
270
  end # list_categories
271
271
 
272
272
  def get_filter_by_unit(
273
- catalog,
274
- unit_id,
275
- vehicle_id,
276
- filter,
277
- ssd,
273
+ catalog:,
274
+ unit_id:,
275
+ vehicle_id:,
276
+ filter:,
277
+ ssd: nil,
278
278
  locale: 'ru_RU'
279
279
  )
280
280
 
@@ -293,10 +293,10 @@ module Laximo
293
293
  end # get_filter_by_unit
294
294
 
295
295
  def get_unit_info(
296
- catalog,
297
- ssd,
298
- unit_id,
299
- localized: false,
296
+ catalog:,
297
+ unit_id:,
298
+ ssd: nil,
299
+ localized: true,
300
300
  locale: 'ru_RU'
301
301
  )
302
302
 
@@ -314,10 +314,10 @@ module Laximo
314
314
  end # get_unit_info
315
315
 
316
316
  def list_detail_by_unit(
317
- catalog,
318
- ssd,
319
- unit_id,
320
- localized: false,
317
+ catalog:,
318
+ unit_id:,
319
+ ssd: nil,
320
+ localized: true,
321
321
  locale: 'ru_RU'
322
322
  )
323
323
 
@@ -335,9 +335,9 @@ module Laximo
335
335
  end # list_detail_by_unit
336
336
 
337
337
  def list_image_map_by_unit(
338
- catalog,
339
- ssd,
340
- unit_id
338
+ catalog:,
339
+ unit_id:,
340
+ ssd: nil
341
341
  )
342
342
 
343
343
  resp = ::Laximo::Query.
@@ -352,12 +352,12 @@ module Laximo
352
352
  end # list_image_map_by_unit
353
353
 
354
354
  def get_filter_by_detail(
355
- catalog,
356
- unit_id,
357
- detail_id,
358
- filter,
359
- ssd,
360
- locale: 'ru_RU'
355
+ catalog:,
356
+ unit_id:,
357
+ detail_id:,
358
+ filter:,
359
+ ssd: nil,
360
+ locale: 'ru_RU'
361
361
  )
362
362
 
363
363
  resp = ::Laximo::Query.
@@ -375,8 +375,8 @@ module Laximo
375
375
  end # get_filter_by_detail
376
376
 
377
377
  def list_quick_group(
378
- catalog,
379
- vehicle_id,
378
+ catalog:,
379
+ vehicle_id:,
380
380
  ssd: nil,
381
381
  locale: 'ru_RU'
382
382
  )
@@ -394,12 +394,12 @@ module Laximo
394
394
  end # list_quick_group
395
395
 
396
396
  def list_quick_detail(
397
- catalog,
398
- vehicle_id,
399
- quick_group_id,
400
- all,
397
+ catalog:,
398
+ vehicle_id:,
399
+ quick_group_id:,
400
+ all:,
401
401
  ssd: nil,
402
- localized: false,
402
+ localized: true,
403
403
  locale: 'ru_RU'
404
404
  )
405
405
 
@@ -199,7 +199,7 @@ module Laximo
199
199
  @str = "#{@func_name}#{@locale}"
200
200
 
201
201
  @query.each { |key, value|
202
- @str << "|#{key}=#{value}" unless value.nil?
202
+ @str << "|#{key}=#{value}"
203
203
  }
204
204
 
205
205
  @str
@@ -1,6 +1,6 @@
1
1
  # encoding: utf-8
2
2
  module Laximo
3
3
 
4
- VERSION = '0.4.2'.freeze
4
+ VERSION = '0.5.0'.freeze
5
5
 
6
6
  end # Laximo
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: laximo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Pilyaev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-07 00:00:00.000000000 Z
11
+ date: 2016-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri