epb_view_models 1.2.3 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +38 -28
- data/epb_view_models.gemspec +1 -1
- data/lib/epb_view_models.rb +1 -1
- data/lib/helper/energy_band_calculator.rb +8 -0
- data/lib/presenter/cepc/report.rb +11 -15
- data/lib/presenter/cepc/summary.rb +5 -14
- data/lib/presenter/dec/report.rb +5 -9
- data/lib/presenter/dec/summary.rb +3 -11
- data/lib/presenter/dec/xml_summary.rb +2 -2
- data/lib/presenter/export/base.rb +4 -4
- data/lib/presenter/export/commercial.rb +16 -27
- data/lib/presenter/export/domestic.rb +30 -39
- data/lib/presenter/rd_sap/domestic_digest.rb +2 -4
- data/lib/presenter/rd_sap/report.rb +47 -57
- data/lib/presenter/rd_sap/summary.rb +13 -21
- data/lib/presenter/sap/domestic_digest.rb +2 -4
- data/lib/presenter/sap/report.rb +49 -59
- data/lib/presenter/sap/summary.rb +27 -41
- data/lib/view_model/cepc31/cepc.rb +4 -44
- data/lib/view_model/cepc31/common_schema.rb +1 -1
- data/lib/view_model/cepc31/dec.rb +14 -34
- data/lib/view_model/cepc40/ac_report.rb +1 -1
- data/lib/view_model/cepc40/cepc.rb +6 -30
- data/lib/view_model/cepc40/common_schema.rb +1 -1
- data/lib/view_model/cepc40/dec.rb +16 -16
- data/lib/view_model/cepc50/ac_report.rb +1 -1
- data/lib/view_model/cepc50/cepc.rb +6 -10
- data/lib/view_model/cepc50/common_schema.rb +1 -1
- data/lib/view_model/cepc50/dec.rb +16 -16
- data/lib/view_model/cepc51/ac_report.rb +1 -1
- data/lib/view_model/cepc51/cepc.rb +6 -6
- data/lib/view_model/cepc51/common_schema.rb +1 -1
- data/lib/view_model/cepc51/dec.rb +16 -16
- data/lib/view_model/cepc60/ac_report.rb +1 -1
- data/lib/view_model/cepc60/cepc.rb +6 -10
- data/lib/view_model/cepc60/common_schema.rb +1 -1
- data/lib/view_model/cepc60/dec.rb +17 -17
- data/lib/view_model/cepc70/ac_cert.rb +3 -3
- data/lib/view_model/cepc70/ac_report.rb +1 -1
- data/lib/view_model/cepc70/cepc.rb +6 -10
- data/lib/view_model/cepc70/common_schema.rb +1 -1
- data/lib/view_model/cepc70/dec.rb +17 -17
- data/lib/view_model/cepc71/ac_cert.rb +3 -3
- data/lib/view_model/cepc71/ac_report.rb +1 -1
- data/lib/view_model/cepc71/cepc.rb +6 -6
- data/lib/view_model/cepc71/common_schema.rb +1 -1
- data/lib/view_model/cepc71/dec.rb +17 -17
- data/lib/view_model/cepc800/ac_cert.rb +3 -3
- data/lib/view_model/cepc800/ac_report.rb +1 -1
- data/lib/view_model/cepc800/cepc.rb +6 -11
- data/lib/view_model/cepc800/common_schema.rb +1 -1
- data/lib/view_model/cepc800/dec.rb +17 -17
- data/lib/view_model/cepc_ni800/ac_cert.rb +3 -3
- data/lib/view_model/cepc_ni800/ac_report.rb +1 -1
- data/lib/view_model/cepc_ni800/cepc.rb +6 -10
- data/lib/view_model/cepc_ni800/common_schema.rb +1 -1
- data/lib/view_model/cepc_ni800/dec.rb +17 -17
- data/lib/view_model/rd_sap_schema_170/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_171/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_180/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_190/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_200/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_210/common_schema.rb +14 -34
- data/lib/view_model/rd_sap_schema_ni_173/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_174/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_180/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_190/common_schema.rb +17 -25
- data/lib/view_model/rd_sap_schema_ni_200/common_schema.rb +17 -25
- data/lib/view_model/sap_schema_102/common_schema.rb +13 -85
- data/lib/view_model/sap_schema_102/rdsap.rb +3 -3
- data/lib/view_model/sap_schema_110/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_110/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_110/sap.rb +1 -1
- data/lib/view_model/sap_schema_112/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_112/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_112/sap.rb +1 -1
- data/lib/view_model/sap_schema_120/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_120/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_120/sap.rb +1 -1
- data/lib/view_model/sap_schema_130/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_130/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_130/sap.rb +1 -1
- data/lib/view_model/sap_schema_140/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_140/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_140/sap.rb +1 -1
- data/lib/view_model/sap_schema_141/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_141/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_141/sap.rb +1 -1
- data/lib/view_model/sap_schema_142/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_142/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_142/sap.rb +1 -1
- data/lib/view_model/sap_schema_150/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_150/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_150/sap.rb +1 -1
- data/lib/view_model/sap_schema_160/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_160/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_160/sap.rb +1 -1
- data/lib/view_model/sap_schema_161/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_161/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_161/sap.rb +1 -1
- data/lib/view_model/sap_schema_162/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_162/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_162/sap.rb +1 -1
- data/lib/view_model/sap_schema_163/common_schema.rb +13 -53
- data/lib/view_model/sap_schema_163/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_163/sap.rb +1 -1
- data/lib/view_model/sap_schema_170/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_171/common_schema.rb +13 -65
- data/lib/view_model/sap_schema_1800/common_schema.rb +12 -64
- data/lib/view_model/sap_schema_1900/common_schema.rb +10 -50
- data/lib/view_model/sap_schema_1910/common_schema.rb +10 -50
- data/lib/view_model/sap_schema_ni_112/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_ni_112/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_112/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_120/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_ni_120/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_120/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_130/common_schema.rb +13 -61
- data/lib/view_model/sap_schema_ni_130/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_130/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_140/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_140/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_140/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_141/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_141/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_141/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_142/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_142/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_142/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_150/common_schema.rb +14 -58
- data/lib/view_model/sap_schema_ni_150/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_150/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_160/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_160/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_160/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_161/common_schema.rb +14 -50
- data/lib/view_model/sap_schema_ni_161/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_161/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_170/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_170/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_170/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_171/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_171/rdsap.rb +3 -19
- data/lib/view_model/sap_schema_ni_171/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_172/common_schema.rb +14 -54
- data/lib/view_model/sap_schema_ni_172/rdsap.rb +3 -23
- data/lib/view_model/sap_schema_ni_172/sap.rb +1 -1
- data/lib/view_model/sap_schema_ni_173/common_schema.rb +10 -78
- data/lib/view_model/sap_schema_ni_174/common_schema.rb +10 -78
- data/lib/view_model/sap_schema_ni_1800/common_schema.rb +10 -78
- metadata +4 -4
@@ -34,11 +34,11 @@ module ViewModel
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def habitable_room_count
|
37
|
-
xpath(%w[Habitable-Room-Count])
|
37
|
+
xpath(%w[Habitable-Room-Count])&.to_i
|
38
38
|
end
|
39
39
|
|
40
40
|
def heated_room_count
|
41
|
-
xpath(%w[Heated-Room-Count])
|
41
|
+
xpath(%w[Heated-Room-Count])&.to_i
|
42
42
|
end
|
43
43
|
|
44
44
|
def photovoltaic_roof_area_percent
|
@@ -58,7 +58,7 @@ module ViewModel
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def storey_count
|
61
|
-
xpath(%w[Storey-Count])
|
61
|
+
xpath(%w[Storey-Count])&.to_i
|
62
62
|
end
|
63
63
|
|
64
64
|
def energy_tariff
|
@@ -69,10 +69,6 @@ module ViewModel
|
|
69
69
|
xpath(%w[Cylinder-Insulation-Thickness])
|
70
70
|
end
|
71
71
|
|
72
|
-
def low_energy_lighting
|
73
|
-
nil
|
74
|
-
end
|
75
|
-
|
76
72
|
def multiple_glazed_proportion
|
77
73
|
xpath(%w[Multiple-Glazed-Proportion])
|
78
74
|
end
|
@@ -89,22 +85,6 @@ module ViewModel
|
|
89
85
|
xpath(%w[Cylinder-Thermostat])
|
90
86
|
end
|
91
87
|
|
92
|
-
def mech_vent_sys_index_number
|
93
|
-
nil
|
94
|
-
end
|
95
|
-
|
96
|
-
def mechanical_vent_data_source
|
97
|
-
nil
|
98
|
-
end
|
99
|
-
|
100
|
-
def thermal_store
|
101
|
-
nil
|
102
|
-
end
|
103
|
-
|
104
|
-
def ventilation_type
|
105
|
-
nil
|
106
|
-
end
|
107
|
-
|
108
88
|
def water_heating_fuel
|
109
89
|
xpath(%w[Water-Heating-Fuel])
|
110
90
|
end
|
@@ -90,7 +90,7 @@ module ViewModel
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def related_party_disclosure_number
|
93
|
-
xpath(%w[Related-Party-Disclosure-Number])
|
93
|
+
xpath(%w[Related-Party-Disclosure-Number])&.to_i
|
94
94
|
end
|
95
95
|
|
96
96
|
def improvements
|
@@ -149,11 +149,11 @@ module ViewModel
|
|
149
149
|
end
|
150
150
|
|
151
151
|
def potential_energy_rating
|
152
|
-
xpath(%w[Energy-Rating-Potential])
|
152
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
153
153
|
end
|
154
154
|
|
155
155
|
def current_energy_rating
|
156
|
-
xpath(%w[Energy-Rating-Current])
|
156
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
157
157
|
end
|
158
158
|
|
159
159
|
def primary_energy_use
|
@@ -196,18 +196,6 @@ module ViewModel
|
|
196
196
|
xpath(%w[Water-Heating])
|
197
197
|
end
|
198
198
|
|
199
|
-
def impact_of_cavity_insulation
|
200
|
-
nil
|
201
|
-
end
|
202
|
-
|
203
|
-
def impact_of_loft_insulation
|
204
|
-
nil
|
205
|
-
end
|
206
|
-
|
207
|
-
def impact_of_solid_wall_insulation
|
208
|
-
nil
|
209
|
-
end
|
210
|
-
|
211
199
|
def country_code
|
212
200
|
xpath(%w[Country-Code])
|
213
201
|
end
|
@@ -229,21 +217,17 @@ module ViewModel
|
|
229
217
|
end
|
230
218
|
|
231
219
|
def environmental_impact_current
|
232
|
-
xpath(%w[Environmental-Impact-Current])
|
220
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
233
221
|
end
|
234
222
|
|
235
223
|
def environmental_impact_potential
|
236
|
-
xpath(%w[Environmental-Impact-Potential])
|
224
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
237
225
|
end
|
238
226
|
|
239
227
|
def co2_emissions_current_per_floor_area
|
240
228
|
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
|
241
229
|
end
|
242
230
|
|
243
|
-
def mains_gas
|
244
|
-
nil
|
245
|
-
end
|
246
|
-
|
247
231
|
def level
|
248
232
|
xpath(%w[Level])
|
249
233
|
end
|
@@ -253,44 +237,24 @@ module ViewModel
|
|
253
237
|
flat_level_code == "3" ? "Y" : "N"
|
254
238
|
end
|
255
239
|
|
256
|
-
def storey_count
|
257
|
-
nil
|
258
|
-
end
|
259
|
-
|
260
240
|
def main_heating_controls
|
261
241
|
xpath(%w[Main-Heating-Controls Description])
|
262
242
|
end
|
263
243
|
|
264
|
-
def multiple_glazed_proportion
|
265
|
-
nil
|
266
|
-
end
|
267
|
-
|
268
|
-
def glazed_area
|
269
|
-
nil
|
270
|
-
end
|
271
|
-
|
272
|
-
def habitable_room_count
|
273
|
-
nil
|
274
|
-
end
|
275
|
-
|
276
|
-
def heated_room_count
|
277
|
-
nil
|
278
|
-
end
|
279
|
-
|
280
244
|
def low_energy_lighting
|
281
245
|
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Percentage])
|
282
246
|
end
|
283
247
|
|
284
248
|
def fixed_lighting_outlets_count
|
285
|
-
xpath(%w[Fixed-Lighting-Outlets-Count])
|
249
|
+
xpath(%w[Fixed-Lighting-Outlets-Count])&.to_i
|
286
250
|
end
|
287
251
|
|
288
252
|
def low_energy_fixed_lighting_outlets_count
|
289
|
-
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])
|
253
|
+
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])&.to_i
|
290
254
|
end
|
291
255
|
|
292
256
|
def open_fireplaces_count
|
293
|
-
xpath(%w[Open-Fireplaces-Count])
|
257
|
+
xpath(%w[Open-Fireplaces-Count])&.to_i
|
294
258
|
end
|
295
259
|
|
296
260
|
def hot_water_description
|
@@ -341,20 +305,8 @@ module ViewModel
|
|
341
305
|
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
342
306
|
end
|
343
307
|
|
344
|
-
def photovoltaic_roof_area_percent
|
345
|
-
nil
|
346
|
-
end
|
347
|
-
|
348
308
|
def wind_turbine_count
|
349
|
-
xpath(%w[Wind-Turbines-Count])
|
350
|
-
end
|
351
|
-
|
352
|
-
def heat_loss_corridor
|
353
|
-
nil
|
354
|
-
end
|
355
|
-
|
356
|
-
def unheated_corridor_length
|
357
|
-
nil
|
309
|
+
xpath(%w[Wind-Turbines-Count])&.to_i
|
358
310
|
end
|
359
311
|
|
360
312
|
def built_form
|
@@ -409,14 +361,6 @@ module ViewModel
|
|
409
361
|
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
410
362
|
end
|
411
363
|
|
412
|
-
def solar_water_heating_flag
|
413
|
-
nil
|
414
|
-
end
|
415
|
-
|
416
|
-
def mechanical_ventilation
|
417
|
-
nil
|
418
|
-
end
|
419
|
-
|
420
364
|
def floor_height
|
421
365
|
@xml_doc.search("Storey-Height").map(&:content)
|
422
366
|
end
|
@@ -439,10 +383,6 @@ module ViewModel
|
|
439
383
|
nil
|
440
384
|
end
|
441
385
|
|
442
|
-
def extensions_count
|
443
|
-
nil
|
444
|
-
end
|
445
|
-
|
446
386
|
def all_main_heating_environmental_efficiency
|
447
387
|
@xml_doc
|
448
388
|
.search("Main-Heating/Environmental-Efficiency-Rating")
|
@@ -494,7 +434,7 @@ module ViewModel
|
|
494
434
|
end
|
495
435
|
|
496
436
|
def mech_vent_sys_index_number
|
497
|
-
xpath(%w[Mechanical-Vent-System-Index-Number])
|
437
|
+
xpath(%w[Mechanical-Vent-System-Index-Number])&.to_i
|
498
438
|
end
|
499
439
|
|
500
440
|
def mechanical_vent_data_source
|
@@ -508,14 +448,6 @@ module ViewModel
|
|
508
448
|
def ventilation_type
|
509
449
|
xpath(%w[Ventilation-Type])
|
510
450
|
end
|
511
|
-
|
512
|
-
def gas_smart_meter_present
|
513
|
-
nil
|
514
|
-
end
|
515
|
-
|
516
|
-
def electricity_smart_meter_present
|
517
|
-
nil
|
518
|
-
end
|
519
451
|
end
|
520
452
|
end
|
521
453
|
end
|
@@ -90,7 +90,7 @@ module ViewModel
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def related_party_disclosure_number
|
93
|
-
xpath(%w[Related-Party-Disclosure-Number])
|
93
|
+
xpath(%w[Related-Party-Disclosure-Number])&.to_i
|
94
94
|
end
|
95
95
|
|
96
96
|
def improvements
|
@@ -149,11 +149,11 @@ module ViewModel
|
|
149
149
|
end
|
150
150
|
|
151
151
|
def potential_energy_rating
|
152
|
-
xpath(%w[Energy-Rating-Potential])
|
152
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
153
153
|
end
|
154
154
|
|
155
155
|
def current_energy_rating
|
156
|
-
xpath(%w[Energy-Rating-Current])
|
156
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
157
157
|
end
|
158
158
|
|
159
159
|
def primary_energy_use
|
@@ -196,18 +196,6 @@ module ViewModel
|
|
196
196
|
xpath(%w[Water-Heating])
|
197
197
|
end
|
198
198
|
|
199
|
-
def impact_of_cavity_insulation
|
200
|
-
nil
|
201
|
-
end
|
202
|
-
|
203
|
-
def impact_of_loft_insulation
|
204
|
-
nil
|
205
|
-
end
|
206
|
-
|
207
|
-
def impact_of_solid_wall_insulation
|
208
|
-
nil
|
209
|
-
end
|
210
|
-
|
211
199
|
def all_main_heating_descriptions
|
212
200
|
@xml_doc.search("Main-Heating/Description").map(&:content)
|
213
201
|
end
|
@@ -233,21 +221,17 @@ module ViewModel
|
|
233
221
|
end
|
234
222
|
|
235
223
|
def environmental_impact_current
|
236
|
-
xpath(%w[Environmental-Impact-Current])
|
224
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
237
225
|
end
|
238
226
|
|
239
227
|
def environmental_impact_potential
|
240
|
-
xpath(%w[Environmental-Impact-Potential])
|
228
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
241
229
|
end
|
242
230
|
|
243
231
|
def co2_emissions_current_per_floor_area
|
244
232
|
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
|
245
233
|
end
|
246
234
|
|
247
|
-
def mains_gas
|
248
|
-
nil
|
249
|
-
end
|
250
|
-
|
251
235
|
def level
|
252
236
|
xpath(%w[Level])
|
253
237
|
end
|
@@ -257,44 +241,24 @@ module ViewModel
|
|
257
241
|
flat_level_code == "3" ? "Y" : "N"
|
258
242
|
end
|
259
243
|
|
260
|
-
def storey_count
|
261
|
-
nil
|
262
|
-
end
|
263
|
-
|
264
244
|
def main_heating_controls
|
265
245
|
xpath(%w[Main-Heating-Controls Description])
|
266
246
|
end
|
267
247
|
|
268
|
-
def multiple_glazed_proportion
|
269
|
-
nil
|
270
|
-
end
|
271
|
-
|
272
|
-
def glazed_area
|
273
|
-
nil
|
274
|
-
end
|
275
|
-
|
276
|
-
def habitable_room_count
|
277
|
-
nil
|
278
|
-
end
|
279
|
-
|
280
|
-
def heated_room_count
|
281
|
-
nil
|
282
|
-
end
|
283
|
-
|
284
248
|
def low_energy_lighting
|
285
249
|
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Percentage])
|
286
250
|
end
|
287
251
|
|
288
252
|
def fixed_lighting_outlets_count
|
289
|
-
xpath(%w[Fixed-Lighting-Outlets-Count])
|
253
|
+
xpath(%w[Fixed-Lighting-Outlets-Count])&.to_i
|
290
254
|
end
|
291
255
|
|
292
256
|
def low_energy_fixed_lighting_outlets_count
|
293
|
-
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])
|
257
|
+
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])&.to_i
|
294
258
|
end
|
295
259
|
|
296
260
|
def open_fireplaces_count
|
297
|
-
xpath(%w[Open-Fireplaces-Count])
|
261
|
+
xpath(%w[Open-Fireplaces-Count])&.to_i
|
298
262
|
end
|
299
263
|
|
300
264
|
def hot_water_description
|
@@ -345,20 +309,8 @@ module ViewModel
|
|
345
309
|
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
346
310
|
end
|
347
311
|
|
348
|
-
def photovoltaic_roof_area_percent
|
349
|
-
nil
|
350
|
-
end
|
351
|
-
|
352
312
|
def wind_turbine_count
|
353
|
-
xpath(%w[Wind-Turbines-Count])
|
354
|
-
end
|
355
|
-
|
356
|
-
def heat_loss_corridor
|
357
|
-
nil
|
358
|
-
end
|
359
|
-
|
360
|
-
def unheated_corridor_length
|
361
|
-
nil
|
313
|
+
xpath(%w[Wind-Turbines-Count])&.to_i
|
362
314
|
end
|
363
315
|
|
364
316
|
def built_form
|
@@ -409,18 +361,6 @@ module ViewModel
|
|
409
361
|
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
410
362
|
end
|
411
363
|
|
412
|
-
def extensions_count
|
413
|
-
nil
|
414
|
-
end
|
415
|
-
|
416
|
-
def solar_water_heating_flag
|
417
|
-
nil
|
418
|
-
end
|
419
|
-
|
420
|
-
def mechanical_ventilation
|
421
|
-
nil
|
422
|
-
end
|
423
|
-
|
424
364
|
def floor_height
|
425
365
|
@xml_doc.search("Storey-Height").map(&:content)
|
426
366
|
end
|
@@ -494,7 +434,7 @@ module ViewModel
|
|
494
434
|
end
|
495
435
|
|
496
436
|
def mech_vent_sys_index_number
|
497
|
-
xpath(%w[Mechanical-Vent-System-Index-Number])
|
437
|
+
xpath(%w[Mechanical-Vent-System-Index-Number])&.to_i
|
498
438
|
end
|
499
439
|
|
500
440
|
def mechanical_vent_data_source
|
@@ -508,14 +448,6 @@ module ViewModel
|
|
508
448
|
def ventilation_type
|
509
449
|
xpath(%w[Ventilation-Type])
|
510
450
|
end
|
511
|
-
|
512
|
-
def gas_smart_meter_present
|
513
|
-
nil
|
514
|
-
end
|
515
|
-
|
516
|
-
def electricity_smart_meter_present
|
517
|
-
nil
|
518
|
-
end
|
519
451
|
end
|
520
452
|
end
|
521
453
|
end
|
@@ -94,7 +94,7 @@ module ViewModel
|
|
94
94
|
end
|
95
95
|
|
96
96
|
def related_party_disclosure_number
|
97
|
-
xpath(%w[Related-Party-Disclosure-Number])
|
97
|
+
xpath(%w[Related-Party-Disclosure-Number])&.to_i
|
98
98
|
end
|
99
99
|
|
100
100
|
def improvements
|
@@ -153,11 +153,11 @@ module ViewModel
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def potential_energy_rating
|
156
|
-
xpath(%w[Energy-Rating-Potential])
|
156
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
157
157
|
end
|
158
158
|
|
159
159
|
def current_energy_rating
|
160
|
-
xpath(%w[Energy-Rating-Current])
|
160
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
161
161
|
end
|
162
162
|
|
163
163
|
def primary_energy_use
|
@@ -200,18 +200,6 @@ module ViewModel
|
|
200
200
|
xpath(%w[Water-Heating])
|
201
201
|
end
|
202
202
|
|
203
|
-
def impact_of_cavity_insulation
|
204
|
-
nil
|
205
|
-
end
|
206
|
-
|
207
|
-
def impact_of_loft_insulation
|
208
|
-
nil
|
209
|
-
end
|
210
|
-
|
211
|
-
def impact_of_solid_wall_insulation
|
212
|
-
nil
|
213
|
-
end
|
214
|
-
|
215
203
|
def all_sap_floor_dimensions
|
216
204
|
@xml_doc.search("SAP-Floor-Dimension").select(&:element?).map { |node|
|
217
205
|
{ total_floor_area: xpath(%w[Total-Floor-Area], node).to_f }
|
@@ -227,10 +215,6 @@ module ViewModel
|
|
227
215
|
flat_level_code == "3" ? "Y" : "N"
|
228
216
|
end
|
229
217
|
|
230
|
-
def storey_count
|
231
|
-
nil
|
232
|
-
end
|
233
|
-
|
234
218
|
def building_part_number
|
235
219
|
xpath(%w[Building-Part-Number])
|
236
220
|
end
|
@@ -298,55 +282,35 @@ module ViewModel
|
|
298
282
|
end
|
299
283
|
|
300
284
|
def environmental_impact_current
|
301
|
-
xpath(%w[Environmental-Impact-Current])
|
285
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
302
286
|
end
|
303
287
|
|
304
288
|
def environmental_impact_potential
|
305
|
-
xpath(%w[Environmental-Impact-Potential])
|
289
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
306
290
|
end
|
307
291
|
|
308
292
|
def co2_emissions_current_per_floor_area
|
309
293
|
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
|
310
294
|
end
|
311
295
|
|
312
|
-
def mains_gas
|
313
|
-
nil
|
314
|
-
end
|
315
|
-
|
316
296
|
def main_heating_controls
|
317
297
|
xpath(%w[Main-Heating-Controls Description])
|
318
298
|
end
|
319
299
|
|
320
|
-
def multiple_glazed_proportion
|
321
|
-
nil
|
322
|
-
end
|
323
|
-
|
324
|
-
def glazed_area
|
325
|
-
nil
|
326
|
-
end
|
327
|
-
|
328
|
-
def habitable_room_count
|
329
|
-
nil
|
330
|
-
end
|
331
|
-
|
332
|
-
def heated_room_count
|
333
|
-
nil
|
334
|
-
end
|
335
|
-
|
336
300
|
def low_energy_lighting
|
337
301
|
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Percentage])
|
338
302
|
end
|
339
303
|
|
340
304
|
def fixed_lighting_outlets_count
|
341
|
-
xpath(%w[Fixed-Lighting-Outlets-Count])
|
305
|
+
xpath(%w[Fixed-Lighting-Outlets-Count])&.to_i
|
342
306
|
end
|
343
307
|
|
344
308
|
def low_energy_fixed_lighting_outlets_count
|
345
|
-
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])
|
309
|
+
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])&.to_i
|
346
310
|
end
|
347
311
|
|
348
312
|
def open_fireplaces_count
|
349
|
-
xpath(%w[Open-Fireplaces-Count])
|
313
|
+
xpath(%w[Open-Fireplaces-Count])&.to_i
|
350
314
|
end
|
351
315
|
|
352
316
|
def hot_water_description
|
@@ -397,26 +361,14 @@ module ViewModel
|
|
397
361
|
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
398
362
|
end
|
399
363
|
|
400
|
-
def photovoltaic_roof_area_percent
|
401
|
-
nil
|
402
|
-
end
|
403
|
-
|
404
364
|
def wind_turbine_count
|
405
|
-
xpath(%w[Wind-Turbines-Count])
|
406
|
-
end
|
407
|
-
|
408
|
-
def heat_loss_corridor
|
409
|
-
nil
|
365
|
+
xpath(%w[Wind-Turbines-Count])&.to_i
|
410
366
|
end
|
411
367
|
|
412
368
|
def all_main_heating_descriptions
|
413
369
|
@xml_doc.search("Main-Heating/Description").map(&:content)
|
414
370
|
end
|
415
371
|
|
416
|
-
def unheated_corridor_length
|
417
|
-
nil
|
418
|
-
end
|
419
|
-
|
420
372
|
def built_form
|
421
373
|
xpath(%w[Built-Form])
|
422
374
|
end
|
@@ -465,18 +417,6 @@ module ViewModel
|
|
465
417
|
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
466
418
|
end
|
467
419
|
|
468
|
-
def extensions_count
|
469
|
-
nil
|
470
|
-
end
|
471
|
-
|
472
|
-
def solar_water_heating_flag
|
473
|
-
nil
|
474
|
-
end
|
475
|
-
|
476
|
-
def mechanical_ventilation
|
477
|
-
nil
|
478
|
-
end
|
479
|
-
|
480
420
|
def floor_height
|
481
421
|
@xml_doc.search("Storey-Height").map(&:content)
|
482
422
|
end
|
@@ -550,7 +490,7 @@ module ViewModel
|
|
550
490
|
end
|
551
491
|
|
552
492
|
def mech_vent_sys_index_number
|
553
|
-
xpath(%w[Mechanical-Vent-System-Index-Number])
|
493
|
+
xpath(%w[Mechanical-Vent-System-Index-Number])&.to_i
|
554
494
|
end
|
555
495
|
|
556
496
|
def mechanical_vent_data_source
|
@@ -564,14 +504,6 @@ module ViewModel
|
|
564
504
|
def ventilation_type
|
565
505
|
xpath(%w[Ventilation-Type])
|
566
506
|
end
|
567
|
-
|
568
|
-
def gas_smart_meter_present
|
569
|
-
nil
|
570
|
-
end
|
571
|
-
|
572
|
-
def electricity_smart_meter_present
|
573
|
-
nil
|
574
|
-
end
|
575
507
|
end
|
576
508
|
end
|
577
509
|
end
|
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:
|
4
|
+
version: 2.0.1
|
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-03-
|
11
|
+
date: 2024-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.16'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.16'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: zeitwerk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|