sports_south 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cbfe858bd8452a03279982ac18abd2e6e4920cf3
4
- data.tar.gz: 873a1fd6fb339e897440112a97d198d523e23777
3
+ metadata.gz: 5797e25692df38391546cc0a0d24b9c5bb13c3c8
4
+ data.tar.gz: 029adc2191ab06e50b37247e905344d8e75d0f80
5
5
  SHA512:
6
- metadata.gz: 47c1a33291c269b850ae24229a1cc60383caceac55a912ab3df70ea531bc28b53f01122f0fde5a84cb0e9c2ce9472129f634118a4587091ba29b444d51ff0683
7
- data.tar.gz: c465721cbea67e3ffc0a01dbae6fa5443ed581923fd0ca824d208ec18166cf8f8f295f75f85e3b9b6d31e3a972d635d0e132d75a5a398d9cf34a7f3af5771659
6
+ metadata.gz: d554b1219b33ad51c95b6f685e6a59b718cc5f81948caf3dd5c5a4ae7a6e3f31b216feb3df9c67ad0408063c5d854bab0a62f3f9fb3e2a21d185459b2ac0126c
7
+ data.tar.gz: f7c2036876d27b7ad93a44f34ab5b5c1ddaa1f976522f4dd4cb158abf54d592f07972dc56331e321c52fea3f875009bc267f3b22842d814dc11500d17455da86
@@ -38,7 +38,7 @@ module SportsSouth
38
38
 
39
39
  raise SportsSouth::NotAuthenticated if not_authenticated?(xml_doc)
40
40
 
41
- xml_doc.css('Table').map { |item| map_hash(item) }
41
+ xml_doc.css('Table').map { |item| map_hash(item, mode: options[:mode]) }
42
42
  end
43
43
 
44
44
  def self.get_text(item_number, options = {})
@@ -150,62 +150,71 @@ module SportsSouth
150
150
 
151
151
  protected
152
152
 
153
- def self.map_hash(node)
154
- {
155
- item_number: content_for(node, 'ITEMNO'),
156
- description: content_for(node, 'IDESC'),
157
- manufacturer_sequence: content_for(node, 'IMFSEQ'),
158
- manufacturer_number: content_for(node, 'IMFGNO'),
159
- catalog_sequence: content_for(node, 'CSEQ'),
160
- item_type: ITEM_TYPES[content_for(node, 'ITYPE')],
161
- short_description: content_for(node, 'SHDESC'),
162
- unit_of_measure: content_for(node, 'UOM'),
163
- catalog_price: content_for(node, 'PRC1'),
164
- customer_price: content_for(node, 'CPRC'),
165
- quantity_on_hand: content_for(node, 'QTYOH'),
166
- weight_per_box: content_for(node, 'WTPBX'),
167
- upc: content_for(node, 'ITUPC'),
168
- manufacturer_item_number: content_for(node, 'MFGINO'),
169
- scan_name_1: content_for(node, 'SCNAM1'),
170
- scan_name_2: content_for(node, 'SCNAM2'),
171
- catalog_code: CATALOG_CODES[content_for(node, 'CATCD')],
172
- mapp_price_code: content_for(node, 'MFPRTYP'),
173
- mapp_price: content_for(node, 'MFPRC'),
174
- category_id: content_for(node, 'CATID'),
175
- text_reference_number: content_for(node, 'TXTREF'),
176
- picture_reference_number: content_for(node, 'PICREF'),
177
- brand_id: content_for(node, 'ITBRDNO'),
178
- item_model_number: content_for(node, 'IMODEL'),
179
- item_purpose: content_for(node, 'IPURPOSE'),
180
- series_description: content_for(node, 'SERIES'),
181
- item_length: content_for(node, 'LENGTH'),
182
- item_height: content_for(node, 'HEIGHT'),
183
- item_width: content_for(node, 'WIDTH'),
184
- item_ships_hazmat_air: content_for(node, 'HAZAIR'),
185
- item_ships_hazmat_ground: content_for(node, 'HAZGRND'),
186
- date_of_last_change: content_for(node, 'CHGDTE'),
187
- date_added: content_for(node, 'CHGDTE'),
188
- attribute_1: content_for(node, 'ITATR1'),
189
- attribute_2: content_for(node, 'ITATR2'),
190
- attribute_3: content_for(node, 'ITATR3'),
191
- attribute_4: content_for(node, 'ITATR4'),
192
- attribute_5: content_for(node, 'ITATR5'),
193
- attribute_6: content_for(node, 'ITATR6'),
194
- attribute_7: content_for(node, 'ITATR7'),
195
- attribute_8: content_for(node, 'ITATR8'),
196
- attribute_9: content_for(node, 'ITATR9'),
197
- attribute_10: content_for(node, 'ITATR0'),
198
- attribute_11: content_for(node, 'ITATR11'),
199
- attribute_12: content_for(node, 'ITATR12'),
200
- attribute_13: content_for(node, 'ITATR13'),
201
- attribute_14: content_for(node, 'ITATR14'),
202
- attribute_15: content_for(node, 'ITATR15'),
203
- attribute_16: content_for(node, 'ITATR16'),
204
- attribute_17: content_for(node, 'ITATR17'),
205
- attribute_18: content_for(node, 'ITATR18'),
206
- attribute_19: content_for(node, 'ITATR19'),
207
- attribute_20: content_for(node, 'ITATR20')
208
- }
153
+ def self.map_hash(node, mode: nil)
154
+ if mode == :minimal
155
+ {
156
+ item_number: content_for(node, 'ITEMNO'),
157
+ catalog_price: content_for(node, 'PRC1'),
158
+ customer_price: content_for(node, 'CPRC'),
159
+ quantity_on_hand: content_for(node, 'QTYOH'),
160
+ }
161
+ else
162
+ {
163
+ item_number: content_for(node, 'ITEMNO'),
164
+ description: content_for(node, 'IDESC'),
165
+ manufacturer_sequence: content_for(node, 'IMFSEQ'),
166
+ manufacturer_number: content_for(node, 'IMFGNO'),
167
+ catalog_sequence: content_for(node, 'CSEQ'),
168
+ item_type: ITEM_TYPES[content_for(node, 'ITYPE')],
169
+ short_description: content_for(node, 'SHDESC'),
170
+ unit_of_measure: content_for(node, 'UOM'),
171
+ catalog_price: content_for(node, 'PRC1'),
172
+ customer_price: content_for(node, 'CPRC'),
173
+ quantity_on_hand: content_for(node, 'QTYOH'),
174
+ weight_per_box: content_for(node, 'WTPBX'),
175
+ upc: content_for(node, 'ITUPC'),
176
+ manufacturer_item_number: content_for(node, 'MFGINO'),
177
+ scan_name_1: content_for(node, 'SCNAM1'),
178
+ scan_name_2: content_for(node, 'SCNAM2'),
179
+ catalog_code: CATALOG_CODES[content_for(node, 'CATCD')],
180
+ mapp_price_code: content_for(node, 'MFPRTYP'),
181
+ mapp_price: content_for(node, 'MFPRC'),
182
+ category_id: content_for(node, 'CATID'),
183
+ text_reference_number: content_for(node, 'TXTREF'),
184
+ picture_reference_number: content_for(node, 'PICREF'),
185
+ brand_id: content_for(node, 'ITBRDNO'),
186
+ item_model_number: content_for(node, 'IMODEL'),
187
+ item_purpose: content_for(node, 'IPURPOSE'),
188
+ series_description: content_for(node, 'SERIES'),
189
+ item_length: content_for(node, 'LENGTH'),
190
+ item_height: content_for(node, 'HEIGHT'),
191
+ item_width: content_for(node, 'WIDTH'),
192
+ item_ships_hazmat_air: content_for(node, 'HAZAIR'),
193
+ item_ships_hazmat_ground: content_for(node, 'HAZGRND'),
194
+ date_of_last_change: content_for(node, 'CHGDTE'),
195
+ date_added: content_for(node, 'CHGDTE'),
196
+ attribute_1: content_for(node, 'ITATR1'),
197
+ attribute_2: content_for(node, 'ITATR2'),
198
+ attribute_3: content_for(node, 'ITATR3'),
199
+ attribute_4: content_for(node, 'ITATR4'),
200
+ attribute_5: content_for(node, 'ITATR5'),
201
+ attribute_6: content_for(node, 'ITATR6'),
202
+ attribute_7: content_for(node, 'ITATR7'),
203
+ attribute_8: content_for(node, 'ITATR8'),
204
+ attribute_9: content_for(node, 'ITATR9'),
205
+ attribute_10: content_for(node, 'ITATR0'),
206
+ attribute_11: content_for(node, 'ITATR11'),
207
+ attribute_12: content_for(node, 'ITATR12'),
208
+ attribute_13: content_for(node, 'ITATR13'),
209
+ attribute_14: content_for(node, 'ITATR14'),
210
+ attribute_15: content_for(node, 'ITATR15'),
211
+ attribute_16: content_for(node, 'ITATR16'),
212
+ attribute_17: content_for(node, 'ITATR17'),
213
+ attribute_18: content_for(node, 'ITATR18'),
214
+ attribute_19: content_for(node, 'ITATR19'),
215
+ attribute_20: content_for(node, 'ITATR20')
216
+ }
217
+ end
209
218
  end
210
219
 
211
220
  end
@@ -1,3 +1,3 @@
1
1
  module SportsSouth
2
- VERSION = '1.1.0'.freeze
2
+ VERSION = '1.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sports_south
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dale Campbell