laximo 0.3.2

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.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +18 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.BSD +24 -0
  5. data/README.md +87 -0
  6. data/laximo.gemspec +26 -0
  7. data/lib/laximo.rb +38 -0
  8. data/lib/laximo/am.rb +113 -0
  9. data/lib/laximo/defaults.rb +10 -0
  10. data/lib/laximo/oem.rb +398 -0
  11. data/lib/laximo/options.rb +92 -0
  12. data/lib/laximo/query.rb +201 -0
  13. data/lib/laximo/request.rb +78 -0
  14. data/lib/laximo/respond.rb +106 -0
  15. data/lib/laximo/respond/find_detail.rb +42 -0
  16. data/lib/laximo/respond/find_oem.rb +42 -0
  17. data/lib/laximo/respond/find_oem_correction.rb +42 -0
  18. data/lib/laximo/respond/find_replacements.rb +20 -0
  19. data/lib/laximo/respond/find_vehicle_by_frame.rb +16 -0
  20. data/lib/laximo/respond/find_vehicle_by_vin.rb +16 -0
  21. data/lib/laximo/respond/find_vehicle_by_wizard.rb +16 -0
  22. data/lib/laximo/respond/find_vehicle_by_wizard2.rb +16 -0
  23. data/lib/laximo/respond/get_catalog_info.rb +16 -0
  24. data/lib/laximo/respond/get_filter_by_detail.rb +16 -0
  25. data/lib/laximo/respond/get_filter_by_unit.rb +16 -0
  26. data/lib/laximo/respond/get_unit_info.rb +16 -0
  27. data/lib/laximo/respond/get_vehicle_info.rb +16 -0
  28. data/lib/laximo/respond/get_wizard.rb +16 -0
  29. data/lib/laximo/respond/get_wizard2.rb +16 -0
  30. data/lib/laximo/respond/get_wizard_next_step2.rb +16 -0
  31. data/lib/laximo/respond/list_catalogs.rb +16 -0
  32. data/lib/laximo/respond/list_categories.rb +16 -0
  33. data/lib/laximo/respond/list_detail_by_unit.rb +16 -0
  34. data/lib/laximo/respond/list_image_map_by_unit.rb +16 -0
  35. data/lib/laximo/respond/list_manufacturer.rb +20 -0
  36. data/lib/laximo/respond/list_quick_detail.rb +16 -0
  37. data/lib/laximo/respond/list_quick_group.rb +16 -0
  38. data/lib/laximo/respond/list_units.rb +16 -0
  39. data/lib/laximo/respond/manufacturer_info.rb +20 -0
  40. data/lib/laximo/version.rb +6 -0
  41. metadata +97 -0
@@ -0,0 +1,42 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindDetail < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+
10
+ str.xpath('//FindDetails/detail').inject([]) { |arr, node|
11
+
12
+ h = attrs_to_hash(node)
13
+
14
+ h[:images] = node.xpath('./images/image').inject([]) { |arr1, n1|
15
+ arr1 << attrs_to_hash(n1)
16
+ }
17
+
18
+ h[:properties] = node.xpath('./properties/property').inject([]) { |arr1, n1|
19
+ arr1 << attrs_to_hash(n1)
20
+ }
21
+
22
+ h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1|
23
+
24
+ h1 = attrs_to_hash(n1)
25
+ h2 = attrs_to_hash(n1.children[0])
26
+ h1.merge!(h2)
27
+
28
+ arr1 << h1
29
+
30
+ }
31
+
32
+ arr << h
33
+
34
+ }
35
+
36
+ end # parsing_result
37
+
38
+ end # FindDetail
39
+
40
+ end # Respond
41
+
42
+ end # Laximo
@@ -0,0 +1,42 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindOem < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+
10
+ str.xpath('//FindOEM/detail').inject([]) { |arr, node|
11
+
12
+ h = attrs_to_hash(node)
13
+
14
+ h[:images] = node.xpath('./images/image').inject([]) { |arr1, n1|
15
+ arr1 << attrs_to_hash(n1)
16
+ }
17
+
18
+ h[:properties] = node.xpath('./properties/property').inject([]) { |arr1, n1|
19
+ arr1 << attrs_to_hash(n1)
20
+ }
21
+
22
+ h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1|
23
+
24
+ h1 = attrs_to_hash(n1)
25
+ h2 = attrs_to_hash(n1.children[0])
26
+ h1.merge!(h2)
27
+
28
+ arr1 << h1
29
+
30
+ }
31
+
32
+ arr << h
33
+
34
+ }
35
+
36
+ end # parsing_result
37
+
38
+ end # FindOem
39
+
40
+ end # Respond
41
+
42
+ end # Laximo
@@ -0,0 +1,42 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindOemCorrection < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+
10
+ str.xpath('//FindOEMCorrection/detail').inject([]) { |arr, node|
11
+
12
+ h = attrs_to_hash(node)
13
+
14
+ h[:images] = node.xpath('./images/image').inject([]) { |arr1, n1|
15
+ arr1 << attrs_to_hash(n1)
16
+ }
17
+
18
+ h[:properties] = node.xpath('./properties/property').inject([]) { |arr1, n1|
19
+ arr1 << attrs_to_hash(n1)
20
+ }
21
+
22
+ h[:replacements] = node.xpath('./replacements/replacement').inject([]) { |arr1, n1|
23
+
24
+ h1 = attrs_to_hash(n1)
25
+ h2 = attrs_to_hash(n1.children[0])
26
+ h1.merge!(h2)
27
+
28
+ arr1 << h1
29
+
30
+ }
31
+
32
+ arr << h
33
+
34
+ }
35
+
36
+ end # parsing_result
37
+
38
+ end # FindOemCorrection
39
+
40
+ end # Respond
41
+
42
+ end # Laximo
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindReplacements < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+
10
+ str.xpath('//FindReplacements/row').inject([]) { |arr, node|
11
+ arr << attrs_to_hash(node)
12
+ }
13
+
14
+ end # parsing_result
15
+
16
+ end # FindReplacements
17
+
18
+ end # Respond
19
+
20
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindVehicleByFrame < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # FindVehicleByFrame
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindVehicleByVin < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # FindVehicleByVin
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindVehicleByWizard < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # FindVehicleByWizard
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class FindVehicleByWizard2 < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # FindVehicleByWizard2
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetCatalogInfo < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetCatalogInfo
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetFilterByDetail < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetFilterByDetail
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetFilterByUnit < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetFilterByUnit
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetUnitInfo < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetUnitInfo
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetVehicleInfo < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetVehicleInfo
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetWizard < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetWizard
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetWizard2 < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetWizard2
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class GetWizardNextStep2 < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # GetWizardNextStep2
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class ListCatalogs < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # ListCatalogs
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class ListCategories < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # ListCategories
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class ListDetailByUnit < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # ListDetailByUnit
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class ListImageMapByUnit < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+ str
10
+ end
11
+
12
+ end # ListImageMapByUnit
13
+
14
+ end # Respond
15
+
16
+ end # Laximo
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+ module Laximo
3
+
4
+ module Respond
5
+
6
+ class ListManufacturer < Laximo::Respond::Base
7
+
8
+ def parsing_result(str)
9
+
10
+ str.xpath('//ListManufacturer/row').inject([]) { |arr, node|
11
+ arr << attrs_to_hash(node)
12
+ }
13
+
14
+ end # parsing_result
15
+
16
+ end # ListManufacturer
17
+
18
+ end # Respond
19
+
20
+ end # Laximo