epb_view_models 1.1.4 → 1.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/api/schemas/data/orchestrate.json +4 -0
  3. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/ExternalDefinitions.xml +1627 -0
  4. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/ExternalDefinitions.xsd +267 -0
  5. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/AssessorManagement.xsd +212 -0
  6. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/EPC-Certificate.xsd +399 -0
  7. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/EPC-CollectedData.xsd +1385 -0
  8. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/Property.xsd +67 -0
  9. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/RdSAP-Report.xsd +179 -0
  10. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/UDT/EPC-Domains.xsd +885 -0
  11. data/api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/UDT/SAP-Domains.xsd +3330 -0
  12. data/lib/epb_view_models.rb +1 -2
  13. data/lib/helper/xml_enums_to_output.rb +45 -2
  14. data/lib/view_model/factory.rb +1 -0
  15. data/lib/view_model/rd_sap_schema_210/common_schema.rb +587 -0
  16. data/lib/view_model/rd_sap_wrapper.rb +2 -0
  17. data/lib/view_model/sap_schema_110/sap.rb +1 -1
  18. data/lib/view_model/sap_schema_112/sap.rb +1 -1
  19. data/lib/view_model/sap_schema_120/sap.rb +1 -1
  20. data/lib/view_model/sap_schema_130/sap.rb +1 -1
  21. data/lib/view_model/sap_schema_140/sap.rb +1 -1
  22. data/lib/view_model/sap_schema_141/sap.rb +1 -1
  23. data/lib/view_model/sap_schema_142/sap.rb +1 -1
  24. data/lib/view_model/sap_schema_150/sap.rb +1 -1
  25. data/lib/view_model/sap_schema_160/sap.rb +1 -1
  26. data/lib/view_model/sap_schema_161/sap.rb +1 -1
  27. data/lib/view_model/sap_schema_162/sap.rb +1 -1
  28. data/lib/view_model/sap_schema_163/sap.rb +1 -1
  29. data/lib/view_model/sap_schema_170/common_schema.rb +1 -1
  30. data/lib/view_model/sap_schema_171/common_schema.rb +1 -1
  31. data/lib/view_model/sap_schema_1800/common_schema.rb +1 -1
  32. data/lib/view_model/sap_schema_1900/common_schema.rb +1 -1
  33. data/lib/view_model/sap_schema_1910/common_schema.rb +1 -1
  34. metadata +13 -3
@@ -0,0 +1,587 @@
1
+ module ViewModel
2
+ module RdSapSchema210
3
+ class CommonSchema < ViewModel::DomesticEpcViewModel
4
+ def assessment_id
5
+ xpath(%w[RRN])
6
+ end
7
+
8
+ def address_line1
9
+ xpath(%w[Property Address Address-Line-1])
10
+ end
11
+
12
+ def address_line2
13
+ xpath(%w[Property Address Address-Line-2]).to_s
14
+ end
15
+
16
+ def address_line3
17
+ xpath(%w[Property Address Address-Line-3]).to_s
18
+ end
19
+
20
+ def address_line4
21
+ xpath(%w[Property Address Address-Line-4]).to_s
22
+ end
23
+
24
+ def town
25
+ xpath(%w[Property Address Post-Town])
26
+ end
27
+
28
+ def postcode
29
+ xpath(%w[Property Address Postcode])
30
+ end
31
+
32
+ def scheme_assessor_id
33
+ xpath(%w[Certificate-Number])
34
+ end
35
+
36
+ def assessor_name
37
+ xpath(%w[Energy-Assessor Name])
38
+ end
39
+
40
+ def assessor_email
41
+ xpath(%w[Energy-Assessor E-Mail])
42
+ end
43
+
44
+ def assessor_telephone
45
+ xpath(%w[Energy-Assessor Telephone])
46
+ end
47
+
48
+ def date_of_assessment
49
+ xpath(%w[Inspection-Date])
50
+ end
51
+
52
+ def date_of_registration
53
+ xpath(%w[Registration-Date])
54
+ end
55
+
56
+ def date_of_completion
57
+ xpath(%w[Completion-Date])
58
+ end
59
+
60
+ def address_id
61
+ xpath(%w[UPRN])
62
+ end
63
+
64
+ def date_of_expiry
65
+ expires_at = (Date.parse(date_of_registration) - 1) >> 12 * 10
66
+
67
+ expires_at.to_s
68
+ end
69
+
70
+ def property_summary
71
+ @xml_doc.search("Energy-Assessment Property-Summary").children.select(
72
+ &:element?
73
+ ).map { |node|
74
+ next if xpath(%w[Energy-Efficiency-Rating], node).nil?
75
+
76
+ {
77
+ energy_efficiency_rating:
78
+ xpath(%w[Energy-Efficiency-Rating], node).to_i,
79
+ environmental_efficiency_rating:
80
+ xpath(%w[Environmental-Efficiency-Rating], node).to_i,
81
+ name: node.name.underscore,
82
+ description: xpath(%w[Description], node),
83
+ }
84
+ }.compact
85
+ end
86
+
87
+ def related_party_disclosure_text
88
+ xpath(%w[Related-Party-Disclosure-Text])
89
+ end
90
+
91
+ def related_party_disclosure_number
92
+ disclosure_number = xpath(%w[Related-Party-Disclosure-Number])
93
+ disclosure_number.nil? ? nil : disclosure_number.to_i
94
+ end
95
+
96
+ def improvements
97
+ @xml_doc
98
+ .search("Suggested-Improvements Improvement")
99
+ .map do |node|
100
+ {
101
+ energy_performance_rating_improvement:
102
+ xpath(%w[Energy-Performance-Rating], node).to_i,
103
+ environmental_impact_rating_improvement:
104
+ xpath(%w[Environmental-Impact-Rating], node).to_i,
105
+ green_deal_category_code: xpath(%w[Green-Deal-Category], node),
106
+ improvement_category: xpath(%w[Improvement-Category], node),
107
+ improvement_code:
108
+ xpath(%w[Improvement-Details Improvement-Number], node),
109
+ improvement_description: xpath(%w[Improvement-Description], node),
110
+ improvement_title: improvement_title(node),
111
+ improvement_type: xpath(%w[Improvement-Type], node),
112
+ indicative_cost: xpath(%w[Indicative-Cost], node),
113
+ sequence: xpath(%w[Sequence], node).to_i,
114
+ typical_saving: xpath(%w[Typical-Saving], node),
115
+ }
116
+ end
117
+ end
118
+
119
+ def recommendations_for_report
120
+ accessor = Accessor::DomesticRecommendationsAccessor.instance
121
+ @xml_doc
122
+ .search("Suggested-Improvements Improvement")
123
+ .map do |node|
124
+ improvement_code = xpath(%w[Improvement-Details Improvement-Number], node)
125
+ {
126
+ sequence: xpath(%w[Sequence], node).to_i,
127
+ improvement_code: xpath(%w[Improvement-Details Improvement-Number], node),
128
+ improvement_summary: improvement_code ? accessor.fetch_details(schema_version: "RdSAP-Schema-20.0.0", improvement_number: improvement_code).summary : xpath(%w[Improvement-Summary], node),
129
+ improvement_description: improvement_code ? accessor.fetch_details(schema_version: "RdSAP-Schema-20.0.0", improvement_number: improvement_code).description : xpath(%w[Improvement-Description], node),
130
+ indicative_cost: xpath(%w[Indicative-Cost], node),
131
+ }
132
+ end
133
+ end
134
+
135
+ def hot_water_cost_potential
136
+ xpath(%w[Hot-Water-Cost-Potential])
137
+ end
138
+
139
+ def heating_cost_potential
140
+ xpath(%w[Heating-Cost-Potential])
141
+ end
142
+
143
+ def lighting_cost_potential
144
+ xpath(%w[Lighting-Cost-Potential])
145
+ end
146
+
147
+ def hot_water_cost_current
148
+ xpath(%w[Hot-Water-Cost-Current])
149
+ end
150
+
151
+ def heating_cost_current
152
+ xpath(%w[Heating-Cost-Current])
153
+ end
154
+
155
+ def lighting_cost_current
156
+ xpath(%w[Lighting-Cost-Current])
157
+ end
158
+
159
+ def potential_carbon_emission
160
+ xpath(%w[CO2-Emissions-Potential])
161
+ end
162
+
163
+ def current_carbon_emission
164
+ xpath(%w[CO2-Emissions-Current])
165
+ end
166
+
167
+ def potential_energy_rating
168
+ xpath(%w[Energy-Rating-Potential]).to_i
169
+ end
170
+
171
+ def current_energy_rating
172
+ xpath(%w[Energy-Rating-Current]).to_i
173
+ end
174
+
175
+ def estimated_energy_cost; end
176
+
177
+ def total_floor_area
178
+ xpath(%w[Property-Summary Total-Floor-Area])
179
+ end
180
+
181
+ def dwelling_type
182
+ xpath(%w[Dwelling-Type])
183
+ end
184
+
185
+ def potential_energy_saving; end
186
+
187
+ def property_age_band
188
+ xpath(%w[Construction-Age-Band])
189
+ end
190
+
191
+ def tenure
192
+ xpath(%w[Tenure])
193
+ end
194
+
195
+ def transaction_type
196
+ xpath(%w[Transaction-Type])
197
+ end
198
+
199
+ def current_space_heating_demand
200
+ xpath(%w[Space-Heating-Existing-Dwelling])
201
+ end
202
+
203
+ def current_water_heating_demand
204
+ xpath(%w[Water-Heating])
205
+ end
206
+
207
+ def impact_of_cavity_insulation
208
+ if xpath(%w[Impact-Of-Cavity-Insulation])
209
+ xpath(%w[Impact-Of-Cavity-Insulation]).to_i
210
+ end
211
+ end
212
+
213
+ def impact_of_loft_insulation
214
+ if xpath(%w[Impact-Of-Loft-Insulation])
215
+ xpath(%w[Impact-Of-Loft-Insulation]).to_i
216
+ end
217
+ end
218
+
219
+ def impact_of_solid_wall_insulation
220
+ if xpath(%w[Impact-Of-Solid-Wall-Insulation])
221
+ xpath(%w[Impact-Of-Solid-Wall-Insulation]).to_i
222
+ end
223
+ end
224
+
225
+ def habitable_room_count
226
+ xpath(%w[Habitable-Room-Count])
227
+ end
228
+
229
+ def energy_rating_current
230
+ xpath(%w[Energy-Rating-Current])
231
+ end
232
+
233
+ def energy_rating_potential
234
+ xpath(%w[Energy-Rating-Potential])
235
+ end
236
+
237
+ def environmental_impact_current
238
+ xpath(%w[Environmental-Impact-Current])
239
+ end
240
+
241
+ def environmental_impact_potential
242
+ xpath(%w[Environmental-Impact-Potential])
243
+ end
244
+
245
+ def primary_energy_use
246
+ xpath(%w[Energy-Consumption-Current])
247
+ end
248
+
249
+ def energy_consumption_potential
250
+ xpath(%w[Energy-Consumption-Potential])
251
+ end
252
+
253
+ def all_roof_descriptions
254
+ @xml_doc.search("Roof/Description").map(&:content)
255
+ end
256
+
257
+ def all_roof_energy_efficiency_rating
258
+ @xml_doc.search("Roof/Energy-Efficiency-Rating").map(&:content)
259
+ end
260
+
261
+ def all_roof_env_energy_efficiency_rating
262
+ @xml_doc.search("Roof/Environmental-Efficiency-Rating").map(&:content)
263
+ end
264
+
265
+ def all_window_descriptions
266
+ @xml_doc.search("Window/Description").map(&:content)
267
+ end
268
+
269
+ def all_main_heating_descriptions
270
+ @xml_doc.search("Main-Heating/Description").map(&:content)
271
+ end
272
+
273
+ def all_main_heating_controls_descriptions
274
+ @xml_doc.search("Main-Heating-Controls/Description").map(&:content)
275
+ end
276
+
277
+ def all_main_heating_energy_efficiency
278
+ @xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
279
+ end
280
+
281
+ def all_main_heating_environmental_efficiency
282
+ @xml_doc
283
+ .search("Main-Heating/Environmental-Efficiency-Rating")
284
+ .map(&:content)
285
+ end
286
+
287
+ def all_hot_water_descriptions
288
+ @xml_doc.search("Hot-Water/Description").map(&:content)
289
+ end
290
+
291
+ def all_lighting_descriptions
292
+ @xml_doc.search("Lighting/Description").map(&:content)
293
+ end
294
+
295
+ def all_secondary_heating_descriptions
296
+ @xml_doc.search("Secondary-Heating/Description").map(&:content)
297
+ end
298
+
299
+ def all_sap_floor_dimensions
300
+ @xml_doc.search("SAP-Floor-Dimension").select(&:element?).map { |node|
301
+ { total_floor_area: xpath(%w[Total-Floor-Area], node).to_f }
302
+ }.compact
303
+ end
304
+
305
+ def level
306
+ xpath(%w[Level])
307
+ end
308
+
309
+ def top_storey
310
+ xpath(%w[Top-Storey])
311
+ end
312
+
313
+ def storey_count
314
+ xpath(%w[Storey-Count])
315
+ end
316
+
317
+ def building_part_number
318
+ xpath(%w[Building-Part-Number])
319
+ end
320
+
321
+ def all_building_parts
322
+ @xml_doc
323
+ .search("SAP-Building-Parts/SAP-Building-Part")
324
+ .map do |part|
325
+ {
326
+ roof_insulation_thickness:
327
+ if part.xpath("Roof-Insulation-Thickness").empty?
328
+ nil
329
+ else
330
+ part.xpath("Roof-Insulation-Thickness").text
331
+ end,
332
+ rafter_insulation_thickness:
333
+ xpath(%w[Rafter-Insulation-Thickness], part),
334
+ flat_roof_insulation_thickness:
335
+ xpath(%w[Flat-Roof-Insulation-Thickness], part),
336
+ sloping_ceiling_insulation_thickness:
337
+ xpath(%w[Sloping-Ceiling-Insulation-Thickness], part),
338
+ roof_u_value: xpath(%w[Roof-U-Value], part),
339
+ roof_room_connected: xpath(%w[Roof-Room-Connected], part),
340
+ }
341
+ end
342
+ end
343
+
344
+ def floor_heat_loss
345
+ xpath(%w[Floor-Heat-Loss])
346
+ end
347
+
348
+ def immersion_heating_type
349
+ xpath(%w[Immersion-Heating-Type])
350
+ end
351
+
352
+ def main_fuel_type
353
+ xpath(%w[Main-Fuel-Type])
354
+ end
355
+
356
+ def secondary_fuel_type
357
+ xpath(%w[Secondary-Fuel-Type])
358
+ end
359
+
360
+ def water_heating_fuel
361
+ xpath(%w[Water-Heating-Fuel])
362
+ end
363
+
364
+ def boiler_flue_type
365
+ xpath(%w[Boiler-Flue-Type])
366
+ end
367
+
368
+ def meter_type
369
+ xpath(%w[Meter-Type])
370
+ end
371
+
372
+ def sap_main_heating_code
373
+ xpath(%w[SAP-Main-Heating-Code])
374
+ end
375
+
376
+ def country_code
377
+ xpath(%w[Country-Code])
378
+ end
379
+
380
+ def co2_emissions_current_per_floor_area
381
+ xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
382
+ end
383
+
384
+ def mains_gas
385
+ xpath(%w[Mains-Gas])
386
+ end
387
+
388
+ def main_heating_controls
389
+ xpath(%w[Main-Heating-Controls Description])
390
+ end
391
+
392
+ def multiple_glazed_proportion
393
+ xpath(%w[Multiple-Glazed-Proportion])
394
+ end
395
+
396
+ def glazed_area
397
+ xpath(%w[Glazed-Area])
398
+ end
399
+
400
+ def heated_room_count
401
+ xpath(%w[Heated-Room-Count])
402
+ end
403
+
404
+ def low_energy_lighting
405
+ xpath(%w[Low-Energy-Lighting])
406
+ end
407
+
408
+ def fixed_lighting_outlets_count
409
+ xpath(%w[Fixed-Lighting-Outlets-Count])
410
+ end
411
+
412
+ def low_energy_fixed_lighting_outlets_count
413
+ xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])
414
+ end
415
+
416
+ def open_fireplaces_count
417
+ xpath(%w[Open-Fireplaces-Count])
418
+ end
419
+
420
+ def hot_water_description
421
+ xpath(%w[Hot-Water Description])
422
+ end
423
+
424
+ def hot_water_energy_efficiency_rating
425
+ xpath(%w[Hot-Water Energy-Efficiency-Rating])
426
+ end
427
+
428
+ def hot_water_environmental_efficiency_rating
429
+ xpath(%w[Hot-Water Environmental-Efficiency-Rating])
430
+ end
431
+
432
+ def wind_turbine_count
433
+ xpath(%w[Wind-Turbines-Count])
434
+ end
435
+
436
+ def heat_loss_corridor
437
+ xpath(%w[Heat-Loss-Corridor])
438
+ end
439
+
440
+ def unheated_corridor_length
441
+ xpath(%w[Unheated-Corridor-Length])
442
+ end
443
+
444
+ def window_description
445
+ xpath(%w[Window Description])
446
+ end
447
+
448
+ def window_energy_efficiency_rating
449
+ xpath(%w[Window Energy-Efficiency-Rating])
450
+ end
451
+
452
+ def window_environmental_efficiency_rating
453
+ xpath(%w[Window Environmental-Efficiency-Rating])
454
+ end
455
+
456
+ def secondary_heating_description
457
+ xpath(%w[Secondary-Heating Description])
458
+ end
459
+
460
+ def secondary_heating_energy_efficiency_rating
461
+ xpath(%w[Secondary-Heating Energy-Efficiency-Rating])
462
+ end
463
+
464
+ def secondary_heating_environmental_efficiency_rating
465
+ xpath(%w[Secondary-Heating Environmental-Efficiency-Rating])
466
+ end
467
+
468
+ def lighting_description
469
+ xpath(%w[Lighting Description])
470
+ end
471
+
472
+ def lighting_energy_efficiency_rating
473
+ xpath(%w[Lighting Energy-Efficiency-Rating])
474
+ end
475
+
476
+ def lighting_environmental_efficiency_rating
477
+ xpath(%w[Lighting Environmental-Efficiency-Rating])
478
+ end
479
+
480
+ def photovoltaic_roof_area_percent
481
+ xpath(%w[Photovoltaic-Supply Percent-Roof-Area])
482
+ end
483
+
484
+ def built_form
485
+ xpath(%w[Built-Form])
486
+ end
487
+
488
+ def extensions_count
489
+ xpath(%w[Extensions-Count])
490
+ end
491
+
492
+ def report_type
493
+ xpath(%w[Report-Type])
494
+ end
495
+
496
+ def all_wall_descriptions
497
+ @xml_doc.search("Wall/Description").map(&:content)
498
+ end
499
+
500
+ def all_wall_energy_efficiency_rating
501
+ @xml_doc.search("Wall/Energy-Efficiency-Rating").map(&:content)
502
+ end
503
+
504
+ def all_wall_env_energy_efficiency_rating
505
+ @xml_doc.search("Wall/Environmental-Efficiency-Rating").map(&:content)
506
+ end
507
+
508
+ def floor_level
509
+ xpath(%w[Flat-Location])
510
+ end
511
+
512
+ def solar_water_heating_flag
513
+ xpath(%w[Solar-Water-Heating])
514
+ end
515
+
516
+ def mechanical_ventilation
517
+ xpath(%w[Mechanical-Ventilation])
518
+ end
519
+
520
+ def floor_height
521
+ @xml_doc.search("Room-Height").map(&:content)
522
+ end
523
+
524
+ def all_floor_descriptions
525
+ @xml_doc.search("Property-Summary/Floor/Description").map(&:content)
526
+ end
527
+
528
+ def all_floor_energy_efficiency_rating
529
+ @xml_doc
530
+ .search("Property-Summary/Floor/Energy-Efficiency-Rating")
531
+ .map(&:content)
532
+ end
533
+
534
+ def all_floor_env_energy_efficiency_rating
535
+ @xml_doc
536
+ .search("Property-Summary/Floor/Environmental-Efficiency-Rating")
537
+ .map(&:content)
538
+ end
539
+
540
+ def all_main_heating_controls_energy_efficiency
541
+ @xml_doc
542
+ .search("Main-Heating-Controls/Energy-Efficiency-Rating")
543
+ .map(&:content)
544
+ end
545
+
546
+ def all_main_heating_controls_environmental_efficiency
547
+ @xml_doc
548
+ .search("Main-Heating-Controls/Environmental-Efficiency-Rating")
549
+ .map(&:content)
550
+ end
551
+
552
+ def main_dwelling_construction_age_band_or_year
553
+ sap_building_parts =
554
+ @xml_doc.xpath("//SAP-Building-Parts/SAP-Building-Part")
555
+ sap_building_parts.each do |sap_building_part|
556
+ building_part_number = sap_building_part.at("Building-Part-Number")
557
+
558
+ # Identifies the Main Dwelling
559
+ if building_part_number&.content == "1"
560
+ return(
561
+ sap_building_part.at_xpath(
562
+ "Construction-Age-Band | Construction-Year",
563
+ )&.content
564
+ )
565
+ end
566
+ end
567
+ nil
568
+ end
569
+
570
+ def cylinder_insul_thickness
571
+ xpath(%w[Cylinder-Insulation-Thickness])
572
+ end
573
+
574
+ def cylinder_insulation_type
575
+ xpath(%w[Cylinder-Insulation-Type])
576
+ end
577
+
578
+ def cylinder_size
579
+ xpath(%w[Cylinder-Size])
580
+ end
581
+
582
+ def has_cylinder_thermostat
583
+ xpath(%w[Cylinder-Thermostat])
584
+ end
585
+ end
586
+ end
587
+ end
@@ -50,6 +50,8 @@ module ViewModel
50
50
 
51
51
  def build_view_model(xml_doc, schema_type)
52
52
  case schema_type
53
+ when :"RdSAP-Schema-21.0.0"
54
+ ViewModel::RdSapSchema210::CommonSchema.new xml_doc
53
55
  when :"RdSAP-Schema-20.0.0"
54
56
  ViewModel::RdSapSchema200::CommonSchema.new xml_doc
55
57
  when :"RdSAP-Schema-19.0"
@@ -59,7 +59,7 @@ module ViewModel
59
59
 
60
60
  def total_roof_area
61
61
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
62
- return nil if roofs.count == 0
62
+ return nil if roofs.count.zero?
63
63
 
64
64
  total_roof_area = 0
65
65
  roofs.each do |roof|
@@ -65,7 +65,7 @@ module ViewModel
65
65
 
66
66
  def total_roof_area
67
67
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
68
- return nil if roofs.count == 0
68
+ return nil if roofs.count.zero?
69
69
 
70
70
  total_roof_area = 0
71
71
  roofs.each do |roof|
@@ -47,7 +47,7 @@ module ViewModel
47
47
 
48
48
  def total_roof_area
49
49
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
50
- return nil if roofs.count == 0
50
+ return nil if roofs.count.zero?
51
51
 
52
52
  total_roof_area = 0
53
53
  roofs.each do |roof|
@@ -47,7 +47,7 @@ module ViewModel
47
47
 
48
48
  def total_roof_area
49
49
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
50
- return nil if roofs.count == 0
50
+ return nil if roofs.count.zero?
51
51
 
52
52
  total_roof_area = 0
53
53
  roofs.each do |roof|
@@ -47,7 +47,7 @@ module ViewModel
47
47
 
48
48
  def total_roof_area
49
49
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
50
- return nil if roofs.count == 0
50
+ return nil if roofs.count.zero?
51
51
 
52
52
  total_roof_area = 0
53
53
  roofs.each do |roof|
@@ -47,7 +47,7 @@ module ViewModel
47
47
 
48
48
  def total_roof_area
49
49
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
50
- return nil if roofs.count == 0
50
+ return nil if roofs.count.zero?
51
51
 
52
52
  total_roof_area = 0
53
53
  roofs.each do |roof|
@@ -47,7 +47,7 @@ module ViewModel
47
47
 
48
48
  def total_roof_area
49
49
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
50
- return nil if roofs.count == 0
50
+ return nil if roofs.count.zero?
51
51
 
52
52
  total_roof_area = 0
53
53
  roofs.each do |roof|
@@ -47,7 +47,7 @@ module ViewModel
47
47
 
48
48
  def total_roof_area
49
49
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
50
- return nil if roofs.count == 0
50
+ return nil if roofs.count.zero?
51
51
 
52
52
  total_roof_area = 0
53
53
  roofs.each do |roof|
@@ -56,7 +56,7 @@ module ViewModel
56
56
 
57
57
  def total_roof_area
58
58
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
59
- return nil if roofs.count == 0
59
+ return nil if roofs.count.zero?
60
60
 
61
61
  total_roof_area = 0
62
62
  roofs.each do |roof|
@@ -56,7 +56,7 @@ module ViewModel
56
56
 
57
57
  def total_roof_area
58
58
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
59
- return nil if roofs.count == 0
59
+ return nil if roofs.count.zero?
60
60
 
61
61
  total_roof_area = 0
62
62
  roofs.each do |roof|
@@ -56,7 +56,7 @@ module ViewModel
56
56
 
57
57
  def total_roof_area
58
58
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
59
- return nil if roofs.count == 0
59
+ return nil if roofs.count.zero?
60
60
 
61
61
  total_roof_area = 0
62
62
  roofs.each do |roof|