epb_view_models 1.1.5 → 1.1.6

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
  SHA256:
3
- metadata.gz: 8a742bfa77d654bc26b9567916ddcb9899ac2b0e7f472aa011ceb309b23d87f3
4
- data.tar.gz: c85f6d0892488f837b4ac82e9bec7a3815c265075a559ebe3d51ff3ce70f8327
3
+ metadata.gz: 674878ef3391968ae102341c4dca08d96a06cde5d8c8faf4bd61d85842e5a53f
4
+ data.tar.gz: '06235595332939fa3eefeab91c660594134fba044c9f917ba7e19e7305545486'
5
5
  SHA512:
6
- metadata.gz: 28d3b8aa7fdeb5d2831ec7dbe15595d9d7b3ee521f9d3730f4a1fa90aaf35947ad584e37c9eb3081710940183a78fb770233c6c9532ad567b4cf72d02c91b4cb
7
- data.tar.gz: f66416fa71cf9a36472fbae670d5e5761e0b730f34d2b326edd2a5894d28c191685b5eb77b9f0fe0c3ea59cebb251afeb7d959552b9627c7de9328d7a94c4385
6
+ metadata.gz: cc81f41d58ac8867590cf8eee82371c2df7754bcacd333130a7cfa84bf010b22c36f4c413620b029f37e2f9d76bacfe61fbb419b88fdd56347702837e704b3ab
7
+ data.tar.gz: 426f8cb0c37903dc652e9aab6431be85c9b52d9443e3eb7e0987fc897bad75cad5048f29af4e02eb6ffb5270d772671e17d6947f2a362de79baf677a40af5337
@@ -123,6 +123,10 @@
123
123
  "schema_path":
124
124
  "api/schemas/xml/SAP-Schema-NI-11.2/Messages/ConditionReportCreateRequest_1.xsd"
125
125
  },
126
+ "RdSAP-Schema-21.0.0": {
127
+ "schema_path":
128
+ "api/schemas/xml/RdSAP-Schema-21.0.0/RdSAP/Templates/RdSAP-Report.xsd"
129
+ },
126
130
  "RdSAP-Schema-20.0.0": {
127
131
  "schema_path":
128
132
  "api/schemas/xml/RdSAP-Schema-20.0.0/RdSAP/Templates/RdSAP-Report.xsd"
@@ -179,6 +179,7 @@ If windows not measured, same as SAP-Data\Energy-Assessment\Property-Summary\Mul
179
179
  </xs:complexType>
180
180
  <xs:element name="Improvement" type="Improvement"/>
181
181
  <xs:complexType name="Improvement">
182
+
182
183
  <xs:all>
183
184
  <xs:element name="Sequence" type="xs:integer">
184
185
  <xs:annotation>
@@ -5,10 +5,9 @@ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
5
5
  loader.setup
6
6
 
7
7
  module EpbViewModels
8
- VERSION = "1.1.5"
8
+ VERSION = "1.1.6"
9
9
  end
10
10
 
11
-
12
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
13
12
  # Source: http://jeffgardner.org/2011/08/04/rails-string-to-boolean-method/
14
13
  class String
@@ -333,10 +333,11 @@ module Helper
333
333
  RDSAP_GLAZED_AREA[value]
334
334
  end
335
335
 
336
- def self.glazed_type_rdsap(value, schema_type = "")
337
- if value =="6" && schemas_post_20.include?(schema_type)
336
+ def self.glazed_type_rdsap(value, schema_type = "")
337
+ if value == "6" && schemas_post_20.include?(schema_type)
338
338
  return RDSAP_GLAZED_TYPE["#{value}-post20"]
339
339
  end
340
+
340
341
  RDSAP_GLAZED_TYPE[value]
341
342
  end
342
343
 
@@ -517,7 +518,6 @@ module Helper
517
518
  SAP-Schema-NI-11.2
518
519
  ].freeze
519
520
 
520
-
521
521
  if types_of_sap_pre12.include?(schema_type) && is_rdsap(report_type)
522
522
  return MECHANICAL_VENTILATION["#{value}-pre12.0"]
523
523
  end
@@ -569,6 +569,7 @@ module Helper
569
569
 
570
570
  def self.fuel_type(value, schema_type = "", report_type = "2")
571
571
  rdsap = %i[
572
+ RdSAP-Schema-21.0.0
572
573
  RdSAP-Schema-20.0.0
573
574
  RdSAP-Schema-19.0
574
575
  RdSAP-Schema-18.0
@@ -671,12 +672,10 @@ module Helper
671
672
 
672
673
  def self.schemas_post_20
673
674
  %i[
674
- RdSAP-Schema-21.0.0
675
+ RdSAP-Schema-21.0.0
675
676
  ]
676
677
  end
677
678
 
678
679
  private_class_method :is_rdsap, :is_sap, :schemas_post_20
679
-
680
-
681
680
  end
682
681
  end
@@ -14,6 +14,7 @@ module ViewModel
14
14
  CEPC-3.1
15
15
  ].freeze
16
16
  TYPES_OF_RD_SAP = %i[
17
+ RdSAP-Schema-21.0.0
17
18
  RdSAP-Schema-20.0.0
18
19
  RdSAP-Schema-19.0
19
20
  RdSAP-Schema-18.0
@@ -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|
@@ -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|
@@ -182,7 +182,7 @@ module ViewModel
182
182
 
183
183
  def total_roof_area
184
184
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
185
- return nil if roofs.count == 0
185
+ return nil if roofs.count.zero?
186
186
 
187
187
  total_roof_area = 0
188
188
  roofs.each do |roof|
@@ -182,7 +182,7 @@ module ViewModel
182
182
 
183
183
  def total_roof_area
184
184
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
185
- return nil if roofs.count == 0
185
+ return nil if roofs.count.zero?
186
186
 
187
187
  total_roof_area = 0
188
188
  roofs.each do |roof|
@@ -184,7 +184,7 @@ module ViewModel
184
184
 
185
185
  def total_roof_area
186
186
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
187
- return nil if roofs.count == 0
187
+ return nil if roofs.count.zero?
188
188
 
189
189
  total_roof_area = 0
190
190
  roofs.each do |roof|
@@ -186,7 +186,7 @@ module ViewModel
186
186
 
187
187
  def total_roof_area
188
188
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
189
- return nil if roofs.count == 0
189
+ return nil if roofs.count.zero?
190
190
 
191
191
  total_roof_area = 0
192
192
  roofs.each do |roof|
@@ -186,7 +186,7 @@ module ViewModel
186
186
 
187
187
  def total_roof_area
188
188
  roofs = @xml_doc.xpath("//SAP-Roofs/SAP-Roof")
189
- return nil if roofs.count == 0
189
+ return nil if roofs.count.zero?
190
190
 
191
191
  total_roof_area = 0
192
192
  roofs.each do |roof|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epb_view_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5
4
+ version: 1.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - DLUHC Energy Performance of Buildings
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-01-05 00:00:00.000000000 Z
11
+ date: 2024-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -1781,6 +1781,7 @@ files:
1781
1781
  - lib/view_model/rd_sap_schema_180/common_schema.rb
1782
1782
  - lib/view_model/rd_sap_schema_190/common_schema.rb
1783
1783
  - lib/view_model/rd_sap_schema_200/common_schema.rb
1784
+ - lib/view_model/rd_sap_schema_210/common_schema.rb
1784
1785
  - lib/view_model/rd_sap_schema_ni_173/common_schema.rb
1785
1786
  - lib/view_model/rd_sap_schema_ni_174/common_schema.rb
1786
1787
  - lib/view_model/rd_sap_schema_ni_180/common_schema.rb