aboutyou-sdk 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +8 -8
  2. data/lib/{aboutyou-sdk/CacheProvider/Dalli.rb → AboutYou/CacheProvider/dalli.rb} +18 -19
  3. data/lib/{aboutyou-sdk/CacheProvider/Redis.rb → AboutYou/CacheProvider/redis.rb} +19 -20
  4. data/lib/{aboutyou-sdk/Criteria/ProductFields.rb → AboutYou/Criteria/product_fields.rb} +25 -27
  5. data/lib/{aboutyou-sdk/Criteria/ProductSearchCriteria.rb → AboutYou/Criteria/product_search_criteria.rb} +128 -123
  6. data/lib/{aboutyou-sdk/Factory/DefaultModelFactory.rb → AboutYou/Factory/default_model_factory.rb} +267 -224
  7. data/lib/AboutYou/Model/Basket/abstract_basket_item.rb +57 -0
  8. data/lib/AboutYou/Model/Basket/basket_item.rb +95 -0
  9. data/lib/AboutYou/Model/Basket/basket_set.rb +199 -0
  10. data/lib/AboutYou/Model/Basket/basket_set_item.rb +54 -0
  11. data/lib/AboutYou/Model/Basket/basket_variant_item.rb +123 -0
  12. data/lib/{aboutyou-sdk/Model/CategoryManager/DefaultCategoryManager.rb → AboutYou/Model/CategoryManager/default_category_manager.rb} +80 -65
  13. data/lib/{aboutyou-sdk/Model/FacetManager/DefaultFacetManager.rb → AboutYou/Model/FacetManager/default_facet_manager.rb} +58 -50
  14. data/lib/{aboutyou-sdk/Model/ProductSearchResult/FacetCount.rb → AboutYou/Model/ProductSearchResult/facet_count.rb} +2 -3
  15. data/lib/AboutYou/Model/ProductSearchResult/facet_counts.rb +67 -0
  16. data/lib/{aboutyou-sdk/Model/ProductSearchResult/PriceRange.rb → AboutYou/Model/ProductSearchResult/price_range.rb} +17 -18
  17. data/lib/AboutYou/Model/ProductSearchResult/sale_counts.rb +79 -0
  18. data/lib/AboutYou/Model/ProductSearchResult/terms_count.rb +40 -0
  19. data/lib/{aboutyou-sdk/Model/AbstractModel.rb → AboutYou/Model/abstract_model.rb} +2 -3
  20. data/lib/{aboutyou-sdk/Model/App.rb → AboutYou/Model/app.rb} +15 -15
  21. data/lib/{aboutyou-sdk/Model/Autocomplete.rb → AboutYou/Model/autocomplete.rb} +25 -32
  22. data/lib/AboutYou/Model/basket.rb +235 -0
  23. data/lib/AboutYou/Model/categories_result.rb +24 -0
  24. data/lib/AboutYou/Model/category.rb +102 -0
  25. data/lib/AboutYou/Model/category_tree.rb +37 -0
  26. data/lib/AboutYou/Model/facet.rb +86 -0
  27. data/lib/AboutYou/Model/facet_group.rb +96 -0
  28. data/lib/AboutYou/Model/facet_group_set.rb +209 -0
  29. data/lib/AboutYou/Model/image.rb +102 -0
  30. data/lib/{aboutyou-sdk/Model/ImageSize.rb → AboutYou/Model/image_size.rb} +9 -5
  31. data/lib/AboutYou/Model/initiate_order.rb +53 -0
  32. data/lib/AboutYou/Model/order.rb +22 -0
  33. data/lib/AboutYou/Model/product.rb +353 -0
  34. data/lib/AboutYou/Model/product_search_result.rb +114 -0
  35. data/lib/AboutYou/Model/products_ean_result.rb +43 -0
  36. data/lib/AboutYou/Model/products_result.rb +56 -0
  37. data/lib/AboutYou/Model/result_error.rb +28 -0
  38. data/lib/AboutYou/Model/variant.rb +214 -0
  39. data/lib/AboutYou/Model/variants_result.rb +91 -0
  40. data/lib/AboutYou/client.rb +128 -0
  41. data/lib/{aboutyou-sdk/Constants.rb → AboutYou/constants.rb} +3 -5
  42. data/lib/AboutYou/query.rb +343 -0
  43. data/lib/AboutYou/query_builder.rb +530 -0
  44. data/lib/ay.rb +566 -0
  45. data/tests/Sinatra-test/Main.rb +3 -0
  46. data/tests/testAutocomplete.rb +5 -6
  47. data/tests/testCatFilter.rb +8 -9
  48. data/tests/testCatTree.rb +3 -3
  49. data/tests/testCategoryCaching.rb +4 -5
  50. data/tests/{testFacetCaching.rb → testDalliCache.rb} +4 -5
  51. data/tests/testFacetTypes.rb +5 -6
  52. data/tests/testFacets.rb +7 -8
  53. data/tests/testFetchFacet.rb +5 -6
  54. data/tests/testJavaScript.rb +3 -4
  55. data/tests/testProdCatLongestPath.rb +7 -8
  56. data/tests/testProductSearchResult.rb +6 -7
  57. data/tests/testProductsByEans.rb +6 -7
  58. data/tests/testProductsByIds.rb +6 -7
  59. data/tests/testRedisCache.rb +4 -5
  60. data/tests/testSuggest.rb +5 -6
  61. data/tests/testVariantsByIds.rb +7 -8
  62. metadata +46 -46
  63. data/lib/aboutyou-sdk.rb +0 -596
  64. data/lib/aboutyou-sdk/Client.rb +0 -134
  65. data/lib/aboutyou-sdk/Model/Basket.rb +0 -268
  66. data/lib/aboutyou-sdk/Model/Basket/AbstractBasketItem.rb +0 -76
  67. data/lib/aboutyou-sdk/Model/Basket/BasketItem.rb +0 -100
  68. data/lib/aboutyou-sdk/Model/Basket/BasketSet.rb +0 -192
  69. data/lib/aboutyou-sdk/Model/Basket/BasketSetItem.rb +0 -46
  70. data/lib/aboutyou-sdk/Model/Basket/BasketVariantItem.rb +0 -137
  71. data/lib/aboutyou-sdk/Model/CategoriesResult.rb +0 -15
  72. data/lib/aboutyou-sdk/Model/Category.rb +0 -126
  73. data/lib/aboutyou-sdk/Model/CategoryTree.rb +0 -35
  74. data/lib/aboutyou-sdk/Model/Facet.rb +0 -105
  75. data/lib/aboutyou-sdk/Model/FacetGroup.rb +0 -110
  76. data/lib/aboutyou-sdk/Model/FacetGroupSet.rb +0 -242
  77. data/lib/aboutyou-sdk/Model/Image.rb +0 -134
  78. data/lib/aboutyou-sdk/Model/InitiateOrder.rb +0 -50
  79. data/lib/aboutyou-sdk/Model/Order.rb +0 -17
  80. data/lib/aboutyou-sdk/Model/Product.rb +0 -335
  81. data/lib/aboutyou-sdk/Model/ProductSearchResult.rb +0 -125
  82. data/lib/aboutyou-sdk/Model/ProductSearchResult/FacetCounts.rb +0 -59
  83. data/lib/aboutyou-sdk/Model/ProductSearchResult/SaleCounts.rb +0 -71
  84. data/lib/aboutyou-sdk/Model/ProductSearchResult/TermsCount.rb +0 -36
  85. data/lib/aboutyou-sdk/Model/ProductsEansResult.rb +0 -47
  86. data/lib/aboutyou-sdk/Model/ProductsResult.rb +0 -52
  87. data/lib/aboutyou-sdk/Model/ResultError.rb +0 -24
  88. data/lib/aboutyou-sdk/Model/Variant.rb +0 -255
  89. data/lib/aboutyou-sdk/Model/VariantsResult.rb +0 -102
  90. data/lib/aboutyou-sdk/Query.rb +0 -350
  91. data/lib/aboutyou-sdk/QueryBuilder.rb +0 -499
@@ -0,0 +1,57 @@
1
+ module AboutYou
2
+ module SDK
3
+ module Model
4
+ ###
5
+ # This class is an abstract model of a basket item
6
+ #
7
+ # author:: Collins GmbH & Co KG
8
+ ###
9
+ module AbstractBasketItem
10
+ IMAGE_URL_REQUIRED = false
11
+ ###
12
+ # Additional data are transmitted to the merchant untouched.
13
+ # If set (array not empty), a key "description" must exist. This description
14
+ # must be a string that describes the variant. If you want to pass a different image URL,
15
+ # you can add a key "image_url" to the $additional_data that contains the URL to the image.
16
+ #
17
+ # @var array $additional_data additional data for this variant
18
+ ###
19
+ attr_accessor :additional_data
20
+ attr_accessor :is_changed
21
+
22
+ ###
23
+ # @return string|null
24
+ ###
25
+ def description
26
+ additional_data['description'] if additional_data
27
+ end
28
+
29
+ ###
30
+ # Additional data are transmitted to the merchant untouched.
31
+ # If set (array not empty), a key "description" must exist. This description
32
+ # must be a string that describes the variant. If you want to pass a different image URL,
33
+ # you can add a key "image_url" to the $additional_data that contains the URL to the image.
34
+ #
35
+ # @param array $additional_data additional data for this variant
36
+ #
37
+ # @throws \InvalidArgumentException
38
+ ###
39
+ def addition_data=(additional_data)
40
+ check_additional_data(additional_data)
41
+ self.is_changed = true
42
+
43
+ self.additional_data = additional_data
44
+ end
45
+
46
+ def check_additional_data(additional_data = nil)
47
+ return false if additional_data || IMAGE_URL_REQUIRED
48
+ fail '\InvalidArgumentException! description is required
49
+ in additional data' if additional_data.key?('description')
50
+ fail '\InvalidArgumentException! image_url is required in
51
+ additional data' if
52
+ IMAGE_URL_REQUIRED && !additional_data.key?('image_url')
53
+ end
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,95 @@
1
+ module AboutYou
2
+ module SDK
3
+ module Model
4
+ ###
5
+ # BasketItem is a class used for adding a variant item into the basket
6
+ #
7
+ # If you want to add a variant into a basket, you need to create an instance
8
+ # of a BasketItem. The BasketItem represents a variant by it's variant_id.
9
+ # It can contain $additional_data that will be transmitted to the merchant untouched.
10
+ #
11
+ # Example usage:
12
+ # $variant_id = $variant->getId(); // $variant is instance of \Collins\ShopApi\Model\Variant
13
+ # $basketItem = new BasketItem('my-personal-identifier', $variant_id);
14
+ # $basketItem->setAdditionalData('jeans with engraving 'for you'', ['engraving_text' => 'for you']);
15
+ # $shop_api->addItemToBasket(session_id(), $basketItem);
16
+ #
17
+ # @see \Collins\ShopApi\Model\Variant
18
+ # @see \Collins\ShopApi\Model\Basket
19
+ # @see \Collins\ShopApi
20
+ ###
21
+ class BasketItem
22
+ include AboutYou::SDK::Model::ResultError
23
+ include AboutYou::SDK::Model::AbstractBasketItem
24
+ include AboutYou::SDK::Model::BasketVariantItem
25
+
26
+ ###
27
+ # The ID of this basket item. You can choose this ID by yourself to identify
28
+ # your item later.
29
+ #
30
+ # @var string $id ID of this basket item
31
+ ###
32
+ attr_accessor :id
33
+
34
+ ###
35
+ # Constructor.
36
+ #
37
+ # @param string $id
38
+ # @param integer $variant_id
39
+ # @param array $additional_data
40
+ ###
41
+ def initialize(id, variant_id, additional_data = nil, app_id = nil)
42
+ check_id(id)
43
+ self.id = id
44
+ super(variant_id, additional_data, app_id)
45
+ end
46
+
47
+ ###
48
+ # @param object $json_object The basket data.
49
+ # @param Product[] $products
50
+ #
51
+ # @return BasketItem
52
+ #
53
+ # @throws \Collins\ShopApi\Exception\UnexpectedResultException
54
+ ###
55
+ def create_from_json(json_object, products)
56
+ item = new(
57
+ json_object['id'],
58
+ json_object['variant_id'],
59
+ if json_object.key?('additional_data')
60
+ [json_object['additional_data']]
61
+ else
62
+ nil
63
+ end,
64
+ json_object.key?('app_id') ? json_object['app_id'] : nil
65
+ )
66
+
67
+ item.parse_error_result(json_object)
68
+ item.json_object = json_object
69
+
70
+ unless json_object['product_id'].empty?
71
+ if products.key?(json_object['product_id'])
72
+ item.product = products[json_object['product_id']]
73
+ else
74
+ fail 'UnexpectedResultException! Product with ID ' +
75
+ String(json_object['product_id']) +
76
+ ' expected but wasnt received with the basket'
77
+ end
78
+ end
79
+
80
+ item
81
+ end
82
+
83
+ ###
84
+ # @param mixed $id
85
+ # @throws \InvalidArgumentException
86
+ ###
87
+ def check_id(id)
88
+ fail '\InvalidArgumentException! ID of the BasketSetItem must be
89
+ a String that must contain minimum two characters' unless
90
+ id.is_a?(String) || id.length < 2
91
+ end
92
+ end
93
+ end
94
+ end
95
+ end
@@ -0,0 +1,199 @@
1
+ module AboutYou
2
+ module SDK
3
+ module Model
4
+ ###
5
+ # BasketSet is a class used for adding a set of variant items into the basket
6
+ #
7
+ # If you want to add a set of variant items into a basket, you need to create an instance
8
+ # of a BasketSet. The BasketSet contains BasketSetItems.
9
+ #
10
+ # A set can be useful if you want to sell several variants as a single product.
11
+ # For example, if you offer a pair of shoes and additionally different styles of shoelaces
12
+ # the customer can choose from, you maybe want to put both - shoes and laces - together.
13
+ #
14
+ # Example usage:
15
+ # $lacesVariantId = $lacesVariant->getId(); // $lacesVariant is instance of \Collins\ShopApi\Model\Variant
16
+ # $shoesVariantID = $shoesVariant->getId(); // $lacesVariant is instance of \Collins\ShopApi\Model\Variant
17
+ # $basketItem1 = new BasketItem($lacesVariantId);
18
+ #
19
+ # $basketSet = new BasketItemSet('my-personal-identifier');
20
+ # $basketSet->addItem(new BasketSetItem($lacesVariantId));
21
+ # $basketSet->addItem(new BasketSetItem($shoesVariantId));
22
+ # $basketSet->setAdditionalData(['description' => 'Shoes with laces 'yellow star'', 'image_url' = 'http://myapp.com/shoes_yello_star.png']);
23
+ # $basket->updateItemSet($basketSet)
24
+ # $shop_api->update_basket(session_id(), $basket);
25
+ #
26
+ # You can use the static method create as an alternative to generate a basket set:
27
+ # $basketSet = BasketItemSet::create(
28
+ # 'my-personal-identifier',
29
+ # [
30
+ # [$lacesVariant->getId()],
31
+ # [$shoesVariantID->getId()],
32
+ # ]
33
+ # );
34
+ # @see create()
35
+ #
36
+ # @see \Collins\ShopApi\Model\Basket
37
+ # @see \Collins\ShopApi\Model\Basket\BasketSetItem
38
+ # @see \Collins\ShopApi\Model\Variant
39
+ # @see \Collins\ShopApi
40
+ ###
41
+ class BasketSet
42
+ include AboutYou::SDK::Model::ResultError
43
+ include AboutYou::SDK::Model::AbstractBasketItem
44
+
45
+ IMAGE_URL_REQUIRED = true
46
+
47
+ ###
48
+ # The ID of this basket item. You can choose this ID by yourself to identify
49
+ # your item later.
50
+ #
51
+ # @var string $id ID of this basket item
52
+ ###
53
+ attr_accessor :id
54
+ attr_accessor :items
55
+ attr_accessor :errors
56
+ attr_accessor :total_price
57
+ attr_accessor :total_net
58
+ attr_accessor :total_vat
59
+ attr_accessor :item_app_id
60
+
61
+ ###
62
+ # Additional data are transmitted to the merchant untouched.
63
+ # If set (array not empty), a key 'description' must exist. This description
64
+ # must be a string that describes the variant. If you want to pass an image URL that
65
+ # represents this item set,
66
+ # you can add a key 'image_url' to the $additional_data that contains the URL to the image.
67
+ #
68
+ # @param string $id ID of the basket item set.
69
+ # @param array $additional_data additional data for this item set
70
+ ###
71
+ def initialize(id, additional_data = nil)
72
+ check_id(id)
73
+ check_additional_data(additional_data, true)
74
+ self.id = id
75
+ self.additional_data = additional_data
76
+ end
77
+
78
+ ###
79
+ # @param \stdClass $json_object
80
+ # @param ModelFactoryInterface $factory
81
+ # @param Product[] $products
82
+ #
83
+ # @return BasketSet
84
+ ###
85
+ def create_from_json(json_object, factory, products)
86
+ set = new(
87
+ json_object['id'],
88
+ if json_object.key?('additional_data')
89
+ [json_object['additional_data']]
90
+ else
91
+ nil
92
+ end
93
+ )
94
+
95
+ set.parse_error_result(json_object)
96
+
97
+ json_object['set_items'].each do |index, json_term|
98
+ item = factory.create_basket_set_item(json_term, products)
99
+ if item.errors?
100
+ set.errors[index] = item
101
+ else
102
+ set.items[index] = item
103
+ end
104
+ end
105
+ if json_object.key?('total_price')
106
+ set.totalPrice = json_object['total_price']
107
+ end
108
+ if json_object.key?('total_net')
109
+ set.totalPrice = json_object['total_net']
110
+ end
111
+ if json_object.key?('total_vat')
112
+ set.totalPrice = json_object['total_vat']
113
+ end
114
+
115
+ set
116
+ end
117
+
118
+ ###
119
+ # Create an basket item set from an array, for example:
120
+ # BasketSet::create(
121
+ # 'identifier4',
122
+ # [
123
+ # [12312121],
124
+ # [7777777, ['description' => 'engravingssens', 'internal_infos' => ['stuff']]]
125
+ # ],
126
+ # ['description' => 'Wunderschön und so']
127
+ # );
128
+ #
129
+ # @param $itemId
130
+ # @param $subItems
131
+ # @param array $additional_data
132
+ #
133
+ # @return BasketSet
134
+ ###
135
+ def create(item_id, sub_items, additional_data = nil)
136
+ set = new(item_id, additional_data)
137
+
138
+ sub_items.each do |item_data|
139
+ set.add_item(
140
+ AboutYou::SDK::Model::BasketSetItem.new(
141
+ item_data[0],
142
+ item_data[1] ? item_data[1] : nil
143
+ )
144
+ )
145
+ end
146
+
147
+ set
148
+ end
149
+
150
+ ###
151
+ # @param BasketSetItem $item
152
+ ###
153
+ def add_item(item)
154
+ if items.count == 0
155
+ self.item_app_id = item.app_id
156
+ elsif item_app_id != item.app_id
157
+ fail '\InvalidArgumentException! you can not set different app ids
158
+ for items in an item-set.'
159
+ end
160
+
161
+ items.push(item)
162
+ end
163
+
164
+ ###
165
+ # @return boolean
166
+ ###
167
+ def errors?
168
+ error_code || errors.count > 0
169
+ end
170
+
171
+ def unique_key
172
+ key = ':'
173
+ unless additional_data
174
+ additional_data.sort!
175
+ key = key + ':' + additional_data.to_json
176
+ end
177
+
178
+ items = []
179
+ self.items.each do |item|
180
+ items.push(item.unique_key)
181
+ end
182
+ key += items.to_json
183
+
184
+ key
185
+ end
186
+
187
+ ###
188
+ # @param mixed $id
189
+ # @throws \InvalidArgumentException
190
+ ###
191
+ def check_id(id)
192
+ fail '\InvalidArgumentException! ID of the BasketSetItem must be a
193
+ String that must contain minimum two characters' unless
194
+ id.is_a?(String) || !id.length < 2
195
+ end
196
+ end
197
+ end
198
+ end
199
+ end
@@ -0,0 +1,54 @@
1
+ module AboutYou
2
+ module SDK
3
+ module Model
4
+ ###
5
+ # BasketSetItem is a class used for adding a variant set item into the basket
6
+ #
7
+ # @see \Collins\ShopApi\Model\Variant
8
+ # @see \Collins\ShopApi\Model\Basket
9
+ # @see \Collins\ShopApi
10
+ ###
11
+ class BasketSetItem
12
+ include AboutYou::SDK::Model::BasketVariantItem
13
+
14
+ ERROR_CODE_PRODUCT_NOT_INCLUDED = 1001
15
+
16
+ ###
17
+ # @param object $json_object The basket data.
18
+ # @param Product[] $products
19
+ #
20
+ # @return BasketVariantItem
21
+ #
22
+ # @throws \Collins\ShopApi\Exception\UnexpectedResultException
23
+ ###
24
+ def create_from_json(json_object, products)
25
+ item = new(
26
+ json_object['variant_id'],
27
+ if json_object.key?('additional_data')
28
+ [json_object['additional_data']]
29
+ else
30
+ nil
31
+ end,
32
+ json_object.key?('app_id') ? json_object['app_id'] : nil
33
+ )
34
+
35
+ item.parse_error_result(json_object)
36
+ item.json_object = json_object
37
+
38
+ unless json_object['product_id'].nil?
39
+ if products.key?(json_object['product_id'])
40
+ item.product = products[json_object['product_id']]
41
+ else
42
+ item.errorCode = ERROR_CODE_PRODUCT_NOT_INCLUDED
43
+ item.errorMessage = 'Product with ID ' +
44
+ json_object['product_id'] + ' expected but wasnt received
45
+ with the basket'
46
+ end
47
+ end
48
+
49
+ item
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,123 @@
1
+ module AboutYou
2
+ module SDK
3
+ module Model
4
+ ###
5
+ # BasketVairantItem is a class representing a basket variant item
6
+ #
7
+ # @see \Collins\ShopApi\Model\Variant
8
+ # @see \Collins\ShopApi\Model\Basket
9
+ # @see \Collins\ShopApi
10
+ ###
11
+ module BasketVariantItem
12
+ attr_accessor :json_object
13
+ attr_accessor :product
14
+ attr_accessor :variant
15
+ attr_accessor :variant_id
16
+ attr_accessor :app_id
17
+
18
+ ###
19
+ # Constructor.
20
+ #
21
+ # @param integer $variant_id
22
+ # @param array $additional_data
23
+ ###
24
+ def initialize(variant_id, additional_data = nil, app_id = nil)
25
+ check_variant_id(variant_id)
26
+ check_addition_data(additional_data)
27
+ self.variant_od = variant_id
28
+ self.additional_data = additional_data
29
+
30
+ return unless app_id
31
+
32
+ check_app_id(app_id)
33
+ self.app_id = app_id
34
+ end
35
+
36
+ ###
37
+ # @return boolean
38
+ ###
39
+ def errors?
40
+ error_code > 0
41
+ end
42
+
43
+ ###
44
+ # Get the total price.
45
+ #
46
+ # @return integer
47
+ ###
48
+ def total_price
49
+ json_object['total_price']
50
+ end
51
+
52
+ ###
53
+ # Get the tax.
54
+ #
55
+ # @return integer
56
+ ###
57
+ def tax
58
+ json_object['tax']
59
+ end
60
+
61
+ ###
62
+ # Get the value added tax.
63
+ #
64
+ # @return integer
65
+ ###
66
+ def total_vat
67
+ json_object['total_vat']
68
+ end
69
+
70
+ ###
71
+ # @return integer
72
+ ###
73
+ def total_net
74
+ json_object['total_net']
75
+ end
76
+
77
+ ###
78
+ # Get the variant old price in euro cents.
79
+ #
80
+ # @return integer
81
+ ###
82
+ def old_price
83
+ variant.old_price
84
+ end
85
+
86
+ ###
87
+ # Get the product variant.
88
+ #
89
+ # @return Variant
90
+ ###
91
+ def variant
92
+ self.variant = product.variant_by_id(variant_id) unless
93
+ @variant && product
94
+
95
+ @variant
96
+ end
97
+
98
+ ###
99
+ # @return string
100
+ ###
101
+ def unique_key
102
+ key = variant_id
103
+ if additionalData
104
+ additionalData.sort!
105
+ key += ':' + additionalData.to_json
106
+ end
107
+
108
+ key
109
+ end
110
+
111
+ def check_variant_id(variant_id)
112
+ fail '\InvalidArgumentException! the variant id must be
113
+ an integer' unless variant_id.is_a?(Integer)
114
+ end
115
+
116
+ def check_app_id(app_id)
117
+ fail '\InvalidArgumentException! the app id must be
118
+ an integer' unless app_id.is_a?(Integer)
119
+ end
120
+ end
121
+ end
122
+ end
123
+ end