epb_view_models 1.2.3 → 2.0.0
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/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
@@ -155,11 +155,11 @@ module ViewModel
|
|
155
155
|
end
|
156
156
|
|
157
157
|
def potential_energy_rating
|
158
|
-
xpath(%w[Energy-Rating-Potential])
|
158
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
159
159
|
end
|
160
160
|
|
161
161
|
def current_energy_rating
|
162
|
-
xpath(%w[Energy-Rating-Current])
|
162
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
163
163
|
end
|
164
164
|
|
165
165
|
def primary_energy_use
|
@@ -200,19 +200,19 @@ module ViewModel
|
|
200
200
|
|
201
201
|
def impact_of_cavity_insulation
|
202
202
|
if xpath(%w[Impact-Of-Cavity-Insulation])
|
203
|
-
xpath(%w[Impact-Of-Cavity-Insulation])
|
203
|
+
xpath(%w[Impact-Of-Cavity-Insulation])&.to_i
|
204
204
|
end
|
205
205
|
end
|
206
206
|
|
207
207
|
def impact_of_loft_insulation
|
208
208
|
if xpath(%w[Impact-Of-Loft-Insulation])
|
209
|
-
xpath(%w[Impact-Of-Loft-Insulation])
|
209
|
+
xpath(%w[Impact-Of-Loft-Insulation])&.to_i
|
210
210
|
end
|
211
211
|
end
|
212
212
|
|
213
213
|
def impact_of_solid_wall_insulation
|
214
214
|
if xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
215
|
-
xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
215
|
+
xpath(%w[Impact-Of-Solid-Wall-Insulation])&.to_i
|
216
216
|
end
|
217
217
|
end
|
218
218
|
|
@@ -229,7 +229,7 @@ module ViewModel
|
|
229
229
|
end
|
230
230
|
|
231
231
|
def type_of_assessment
|
232
|
-
case xpath(%w[Report-Type])
|
232
|
+
case xpath(%w[Report-Type])&.to_i
|
233
233
|
when 1
|
234
234
|
"HCR"
|
235
235
|
when 2
|
@@ -240,21 +240,17 @@ module ViewModel
|
|
240
240
|
end
|
241
241
|
|
242
242
|
def environmental_impact_current
|
243
|
-
xpath(%w[Environmental-Impact-Current])
|
243
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
244
244
|
end
|
245
245
|
|
246
246
|
def environmental_impact_potential
|
247
|
-
xpath(%w[Environmental-Impact-Potential])
|
247
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
248
248
|
end
|
249
249
|
|
250
250
|
def co2_emissions_current_per_floor_area
|
251
251
|
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
|
252
252
|
end
|
253
253
|
|
254
|
-
def mains_gas
|
255
|
-
nil
|
256
|
-
end
|
257
|
-
|
258
254
|
def level
|
259
255
|
xpath(%w[Level])
|
260
256
|
end
|
@@ -264,10 +260,6 @@ module ViewModel
|
|
264
260
|
flat_level_code == "3" ? "Y" : "N"
|
265
261
|
end
|
266
262
|
|
267
|
-
def storey_count
|
268
|
-
nil
|
269
|
-
end
|
270
|
-
|
271
263
|
def main_heating_controls
|
272
264
|
xpath(%w[Main-Heating-Controls Description])
|
273
265
|
end
|
@@ -276,32 +268,20 @@ module ViewModel
|
|
276
268
|
xpath(%w[Multiple-Glazed-Proportion])
|
277
269
|
end
|
278
270
|
|
279
|
-
def glazed_area
|
280
|
-
nil
|
281
|
-
end
|
282
|
-
|
283
|
-
def habitable_room_count
|
284
|
-
nil
|
285
|
-
end
|
286
|
-
|
287
|
-
def heated_room_count
|
288
|
-
nil
|
289
|
-
end
|
290
|
-
|
291
271
|
def low_energy_lighting
|
292
272
|
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Percentage])
|
293
273
|
end
|
294
274
|
|
295
275
|
def fixed_lighting_outlets_count
|
296
|
-
xpath(%w[Fixed-Lighting-Outlets-Count])
|
276
|
+
xpath(%w[Fixed-Lighting-Outlets-Count])&.to_i
|
297
277
|
end
|
298
278
|
|
299
279
|
def low_energy_fixed_lighting_outlets_count
|
300
|
-
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])
|
280
|
+
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])&.to_i
|
301
281
|
end
|
302
282
|
|
303
283
|
def open_fireplaces_count
|
304
|
-
xpath(%w[Open-Fireplaces-Count])
|
284
|
+
xpath(%w[Open-Fireplaces-Count])&.to_i
|
305
285
|
end
|
306
286
|
|
307
287
|
def hot_water_description
|
@@ -352,16 +332,12 @@ module ViewModel
|
|
352
332
|
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
353
333
|
end
|
354
334
|
|
355
|
-
def photovoltaic_roof_area_percent
|
356
|
-
nil
|
357
|
-
end
|
358
|
-
|
359
335
|
def built_form
|
360
336
|
xpath(%w[Built-Form])
|
361
337
|
end
|
362
338
|
|
363
339
|
def wind_turbine_count
|
364
|
-
xpath(%w[Wind-Turbines-Count])
|
340
|
+
xpath(%w[Wind-Turbines-Count])&.to_i
|
365
341
|
end
|
366
342
|
|
367
343
|
def heat_loss_corridor
|
@@ -377,7 +353,7 @@ module ViewModel
|
|
377
353
|
end
|
378
354
|
|
379
355
|
def extensions_count
|
380
|
-
xpath(%w[Extensions-Count])
|
356
|
+
xpath(%w[Extensions-Count])&.to_i
|
381
357
|
end
|
382
358
|
|
383
359
|
def all_main_heating_controls_descriptions
|
@@ -424,14 +400,6 @@ module ViewModel
|
|
424
400
|
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
425
401
|
end
|
426
402
|
|
427
|
-
def solar_water_heating_flag
|
428
|
-
nil
|
429
|
-
end
|
430
|
-
|
431
|
-
def mechanical_ventilation
|
432
|
-
nil
|
433
|
-
end
|
434
|
-
|
435
403
|
def main_dwelling_construction_age_band_or_year
|
436
404
|
sap_building_parts =
|
437
405
|
@xml_doc.xpath("//SAP-Building-Parts/SAP-Building-Part")
|
@@ -487,14 +455,6 @@ module ViewModel
|
|
487
455
|
def floor_height
|
488
456
|
@xml_doc.search("Storey-Height").map(&:content)
|
489
457
|
end
|
490
|
-
|
491
|
-
def gas_smart_meter_present
|
492
|
-
nil
|
493
|
-
end
|
494
|
-
|
495
|
-
def electricity_smart_meter_present
|
496
|
-
nil
|
497
|
-
end
|
498
458
|
end
|
499
459
|
end
|
500
460
|
end
|
@@ -42,11 +42,11 @@ module ViewModel
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def habitable_room_count
|
45
|
-
xpath(%w[Habitable-Room-Count])
|
45
|
+
xpath(%w[Habitable-Room-Count])&.to_i
|
46
46
|
end
|
47
47
|
|
48
48
|
def heated_room_count
|
49
|
-
xpath(%w[Heated-Room-Count])
|
49
|
+
xpath(%w[Heated-Room-Count])&.to_i
|
50
50
|
end
|
51
51
|
|
52
52
|
def photovoltaic_roof_area_percent
|
@@ -62,7 +62,7 @@ module ViewModel
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def storey_count
|
65
|
-
xpath(%w[Storey-Count])
|
65
|
+
xpath(%w[Storey-Count])&.to_i
|
66
66
|
end
|
67
67
|
|
68
68
|
def energy_tariff
|
@@ -85,22 +85,6 @@ module ViewModel
|
|
85
85
|
xpath(%w[Cylinder-Thermostat])
|
86
86
|
end
|
87
87
|
|
88
|
-
def mech_vent_sys_index_number
|
89
|
-
nil
|
90
|
-
end
|
91
|
-
|
92
|
-
def mechanical_vent_data_source
|
93
|
-
nil
|
94
|
-
end
|
95
|
-
|
96
|
-
def thermal_store
|
97
|
-
nil
|
98
|
-
end
|
99
|
-
|
100
|
-
def ventilation_type
|
101
|
-
nil
|
102
|
-
end
|
103
|
-
|
104
88
|
def water_heating_fuel
|
105
89
|
xpath(%w[Water-Heating-Fuel])
|
106
90
|
end
|
@@ -85,7 +85,7 @@ module ViewModel
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def related_party_disclosure_number
|
88
|
-
xpath(%w[Related-Party-Disclosure-Number])
|
88
|
+
xpath(%w[Related-Party-Disclosure-Number])&.to_i
|
89
89
|
end
|
90
90
|
|
91
91
|
def improvements
|
@@ -159,11 +159,11 @@ module ViewModel
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def potential_energy_rating
|
162
|
-
xpath(%w[Energy-Rating-Potential])
|
162
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
163
163
|
end
|
164
164
|
|
165
165
|
def current_energy_rating
|
166
|
-
xpath(%w[Energy-Rating-Current])
|
166
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
167
167
|
end
|
168
168
|
|
169
169
|
def primary_energy_use
|
@@ -238,19 +238,19 @@ module ViewModel
|
|
238
238
|
|
239
239
|
def impact_of_cavity_insulation
|
240
240
|
if xpath(%w[Impact-Of-Cavity-Insulation])
|
241
|
-
xpath(%w[Impact-Of-Cavity-Insulation])
|
241
|
+
xpath(%w[Impact-Of-Cavity-Insulation])&.to_i
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
245
|
def impact_of_loft_insulation
|
246
246
|
if xpath(%w[Impact-Of-Loft-Insulation])
|
247
|
-
xpath(%w[Impact-Of-Loft-Insulation])
|
247
|
+
xpath(%w[Impact-Of-Loft-Insulation])&.to_i
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
251
251
|
def impact_of_solid_wall_insulation
|
252
252
|
if xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
253
|
-
xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
253
|
+
xpath(%w[Impact-Of-Solid-Wall-Insulation])&.to_i
|
254
254
|
end
|
255
255
|
end
|
256
256
|
|
@@ -275,21 +275,17 @@ module ViewModel
|
|
275
275
|
end
|
276
276
|
|
277
277
|
def environmental_impact_current
|
278
|
-
xpath(%w[Environmental-Impact-Current])
|
278
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
279
279
|
end
|
280
280
|
|
281
281
|
def environmental_impact_potential
|
282
|
-
xpath(%w[Environmental-Impact-Potential])
|
282
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
283
283
|
end
|
284
284
|
|
285
285
|
def co2_emissions_current_per_floor_area
|
286
286
|
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
|
287
287
|
end
|
288
288
|
|
289
|
-
def mains_gas
|
290
|
-
nil
|
291
|
-
end
|
292
|
-
|
293
289
|
def level
|
294
290
|
xpath(%w[Level])
|
295
291
|
end
|
@@ -299,10 +295,6 @@ module ViewModel
|
|
299
295
|
flat_level_code == "3" ? "Y" : "N"
|
300
296
|
end
|
301
297
|
|
302
|
-
def storey_count
|
303
|
-
nil
|
304
|
-
end
|
305
|
-
|
306
298
|
def main_heating_controls
|
307
299
|
xpath(%w[Main-Heating-Controls Description])
|
308
300
|
end
|
@@ -311,32 +303,20 @@ module ViewModel
|
|
311
303
|
xpath(%w[Multiple-Glazed-Percentage])
|
312
304
|
end
|
313
305
|
|
314
|
-
def glazed_area
|
315
|
-
nil
|
316
|
-
end
|
317
|
-
|
318
|
-
def habitable_room_count
|
319
|
-
nil
|
320
|
-
end
|
321
|
-
|
322
|
-
def heated_room_count
|
323
|
-
nil
|
324
|
-
end
|
325
|
-
|
326
306
|
def low_energy_lighting
|
327
307
|
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Percentage])
|
328
308
|
end
|
329
309
|
|
330
310
|
def fixed_lighting_outlets_count
|
331
|
-
xpath(%w[Fixed-Lighting-Outlets-Count])
|
311
|
+
xpath(%w[Fixed-Lighting-Outlets-Count])&.to_i
|
332
312
|
end
|
333
313
|
|
334
314
|
def low_energy_fixed_lighting_outlets_count
|
335
|
-
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])
|
315
|
+
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])&.to_i
|
336
316
|
end
|
337
317
|
|
338
318
|
def open_fireplaces_count
|
339
|
-
xpath(%w[Open-Fireplaces-Count])
|
319
|
+
xpath(%w[Open-Fireplaces-Count])&.to_i
|
340
320
|
end
|
341
321
|
|
342
322
|
def hot_water_description
|
@@ -387,24 +367,12 @@ module ViewModel
|
|
387
367
|
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
388
368
|
end
|
389
369
|
|
390
|
-
def photovoltaic_roof_area_percent
|
391
|
-
nil
|
392
|
-
end
|
393
|
-
|
394
370
|
def built_form
|
395
371
|
xpath(%w[Built-Form])
|
396
372
|
end
|
397
373
|
|
398
374
|
def wind_turbine_count
|
399
|
-
xpath(%w[Wind-Turbines-Count])
|
400
|
-
end
|
401
|
-
|
402
|
-
def heat_loss_corridor
|
403
|
-
nil
|
404
|
-
end
|
405
|
-
|
406
|
-
def unheated_corridor_length
|
407
|
-
nil
|
375
|
+
xpath(%w[Wind-Turbines-Count])&.to_i
|
408
376
|
end
|
409
377
|
|
410
378
|
def all_main_heating_descriptions
|
@@ -451,18 +419,6 @@ module ViewModel
|
|
451
419
|
xpath(%w[SAP-Flat-Details Level])
|
452
420
|
end
|
453
421
|
|
454
|
-
def extensions_count
|
455
|
-
nil
|
456
|
-
end
|
457
|
-
|
458
|
-
def solar_water_heating_flag
|
459
|
-
nil
|
460
|
-
end
|
461
|
-
|
462
|
-
def mechanical_ventilation
|
463
|
-
nil
|
464
|
-
end
|
465
|
-
|
466
422
|
def floor_height
|
467
423
|
@xml_doc.search("Storey-Height").map(&:content)
|
468
424
|
end
|
@@ -522,7 +478,7 @@ module ViewModel
|
|
522
478
|
end
|
523
479
|
|
524
480
|
def mech_vent_sys_index_number
|
525
|
-
xpath(%w[Mechanical-Vent-System-Index-Number])
|
481
|
+
xpath(%w[Mechanical-Vent-System-Index-Number])&.to_i
|
526
482
|
end
|
527
483
|
|
528
484
|
def mechanical_vent_data_source
|
@@ -536,14 +492,6 @@ module ViewModel
|
|
536
492
|
def ventilation_type
|
537
493
|
xpath(%w[Ventilation-Type])
|
538
494
|
end
|
539
|
-
|
540
|
-
def gas_smart_meter_present
|
541
|
-
nil
|
542
|
-
end
|
543
|
-
|
544
|
-
def electricity_smart_meter_present
|
545
|
-
nil
|
546
|
-
end
|
547
495
|
end
|
548
496
|
end
|
549
497
|
end
|
@@ -85,7 +85,7 @@ module ViewModel
|
|
85
85
|
end
|
86
86
|
|
87
87
|
def related_party_disclosure_number
|
88
|
-
xpath(%w[Related-Party-Disclosure-Number])
|
88
|
+
xpath(%w[Related-Party-Disclosure-Number])&.to_i
|
89
89
|
end
|
90
90
|
|
91
91
|
def improvements
|
@@ -159,11 +159,11 @@ module ViewModel
|
|
159
159
|
end
|
160
160
|
|
161
161
|
def potential_energy_rating
|
162
|
-
xpath(%w[Energy-Rating-Potential])
|
162
|
+
xpath(%w[Energy-Rating-Potential])&.to_i
|
163
163
|
end
|
164
164
|
|
165
165
|
def current_energy_rating
|
166
|
-
xpath(%w[Energy-Rating-Current])
|
166
|
+
xpath(%w[Energy-Rating-Current])&.to_i
|
167
167
|
end
|
168
168
|
|
169
169
|
def primary_energy_use
|
@@ -238,19 +238,19 @@ module ViewModel
|
|
238
238
|
|
239
239
|
def impact_of_cavity_insulation
|
240
240
|
if xpath(%w[Impact-Of-Cavity-Insulation])
|
241
|
-
xpath(%w[Impact-Of-Cavity-Insulation])
|
241
|
+
xpath(%w[Impact-Of-Cavity-Insulation])&.to_i
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
245
|
def impact_of_loft_insulation
|
246
246
|
if xpath(%w[Impact-Of-Loft-Insulation])
|
247
|
-
xpath(%w[Impact-Of-Loft-Insulation])
|
247
|
+
xpath(%w[Impact-Of-Loft-Insulation])&.to_i
|
248
248
|
end
|
249
249
|
end
|
250
250
|
|
251
251
|
def impact_of_solid_wall_insulation
|
252
252
|
if xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
253
|
-
xpath(%w[Impact-Of-Solid-Wall-Insulation])
|
253
|
+
xpath(%w[Impact-Of-Solid-Wall-Insulation])&.to_i
|
254
254
|
end
|
255
255
|
end
|
256
256
|
|
@@ -275,21 +275,17 @@ module ViewModel
|
|
275
275
|
end
|
276
276
|
|
277
277
|
def environmental_impact_current
|
278
|
-
xpath(%w[Environmental-Impact-Current])
|
278
|
+
xpath(%w[Environmental-Impact-Current])&.to_i
|
279
279
|
end
|
280
280
|
|
281
281
|
def environmental_impact_potential
|
282
|
-
xpath(%w[Environmental-Impact-Potential])
|
282
|
+
xpath(%w[Environmental-Impact-Potential])&.to_i
|
283
283
|
end
|
284
284
|
|
285
285
|
def co2_emissions_current_per_floor_area
|
286
286
|
xpath(%w[CO2-Emissions-Current-Per-Floor-Area])
|
287
287
|
end
|
288
288
|
|
289
|
-
def mains_gas
|
290
|
-
nil
|
291
|
-
end
|
292
|
-
|
293
289
|
def level
|
294
290
|
xpath(%w[Level])
|
295
291
|
end
|
@@ -299,10 +295,6 @@ module ViewModel
|
|
299
295
|
flat_level_code == "3" ? "Y" : "N"
|
300
296
|
end
|
301
297
|
|
302
|
-
def storey_count
|
303
|
-
nil
|
304
|
-
end
|
305
|
-
|
306
298
|
def main_heating_controls
|
307
299
|
xpath(%w[Main-Heating-Controls Description])
|
308
300
|
end
|
@@ -311,32 +303,20 @@ module ViewModel
|
|
311
303
|
xpath(%w[Multiple-Glazed-Percentage])
|
312
304
|
end
|
313
305
|
|
314
|
-
def glazed_area
|
315
|
-
nil
|
316
|
-
end
|
317
|
-
|
318
|
-
def habitable_room_count
|
319
|
-
nil
|
320
|
-
end
|
321
|
-
|
322
|
-
def heated_room_count
|
323
|
-
nil
|
324
|
-
end
|
325
|
-
|
326
306
|
def low_energy_lighting
|
327
307
|
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Percentage])
|
328
308
|
end
|
329
309
|
|
330
310
|
def fixed_lighting_outlets_count
|
331
|
-
xpath(%w[Fixed-Lighting-Outlets-Count])
|
311
|
+
xpath(%w[Fixed-Lighting-Outlets-Count])&.to_i
|
332
312
|
end
|
333
313
|
|
334
314
|
def low_energy_fixed_lighting_outlets_count
|
335
|
-
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])
|
315
|
+
xpath(%w[Low-Energy-Fixed-Lighting-Outlets-Count])&.to_i
|
336
316
|
end
|
337
317
|
|
338
318
|
def open_fireplaces_count
|
339
|
-
xpath(%w[Open-Fireplaces-Count])
|
319
|
+
xpath(%w[Open-Fireplaces-Count])&.to_i
|
340
320
|
end
|
341
321
|
|
342
322
|
def hot_water_description
|
@@ -356,15 +336,7 @@ module ViewModel
|
|
356
336
|
end
|
357
337
|
|
358
338
|
def wind_turbine_count
|
359
|
-
xpath(%w[Wind-Turbines-Count])
|
360
|
-
end
|
361
|
-
|
362
|
-
def heat_loss_corridor
|
363
|
-
nil
|
364
|
-
end
|
365
|
-
|
366
|
-
def unheated_corridor_length
|
367
|
-
nil
|
339
|
+
xpath(%w[Wind-Turbines-Count])&.to_i
|
368
340
|
end
|
369
341
|
|
370
342
|
def window_energy_efficiency_rating
|
@@ -399,10 +371,6 @@ module ViewModel
|
|
399
371
|
xpath(%w[Lighting Environmental-Efficiency-Rating])
|
400
372
|
end
|
401
373
|
|
402
|
-
def photovoltaic_roof_area_percent
|
403
|
-
nil
|
404
|
-
end
|
405
|
-
|
406
374
|
def built_form
|
407
375
|
xpath(%w[Built-Form])
|
408
376
|
end
|
@@ -455,18 +423,6 @@ module ViewModel
|
|
455
423
|
@xml_doc.search("Main-Heating/Energy-Efficiency-Rating").map(&:content)
|
456
424
|
end
|
457
425
|
|
458
|
-
def extensions_count
|
459
|
-
nil
|
460
|
-
end
|
461
|
-
|
462
|
-
def solar_water_heating_flag
|
463
|
-
nil
|
464
|
-
end
|
465
|
-
|
466
|
-
def mechanical_ventilation
|
467
|
-
nil
|
468
|
-
end
|
469
|
-
|
470
426
|
def floor_height
|
471
427
|
@xml_doc.search("Storey-Height").map(&:content)
|
472
428
|
end
|
@@ -522,7 +478,7 @@ module ViewModel
|
|
522
478
|
end
|
523
479
|
|
524
480
|
def mech_vent_sys_index_number
|
525
|
-
xpath(%w[Mechanical-Vent-System-Index-Number])
|
481
|
+
xpath(%w[Mechanical-Vent-System-Index-Number])&.to_i
|
526
482
|
end
|
527
483
|
|
528
484
|
def mechanical_vent_data_source
|
@@ -536,14 +492,6 @@ module ViewModel
|
|
536
492
|
def ventilation_type
|
537
493
|
xpath(%w[Ventilation-Type])
|
538
494
|
end
|
539
|
-
|
540
|
-
def gas_smart_meter_present
|
541
|
-
nil
|
542
|
-
end
|
543
|
-
|
544
|
-
def electricity_smart_meter_present
|
545
|
-
nil
|
546
|
-
end
|
547
495
|
end
|
548
496
|
end
|
549
497
|
end
|