epb_view_models 1.2.2 → 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 +28 -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
@@ -18,7 +18,7 @@ module ViewModel
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def energy_efficiency_rating
|
21
|
-
xpath(%w[This-Assessment Energy-Rating])
|
21
|
+
xpath(%w[This-Assessment Energy-Rating])&.to_i
|
22
22
|
end
|
23
23
|
|
24
24
|
def current_assessment_date
|
@@ -26,15 +26,15 @@ module ViewModel
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def current_heating_co2
|
29
|
-
xpath(%w[This-Assessment Heating-CO2])
|
29
|
+
xpath(%w[This-Assessment Heating-CO2])&.to_i
|
30
30
|
end
|
31
31
|
|
32
32
|
def current_electricity_co2
|
33
|
-
xpath(%w[This-Assessment Electricity-CO2])
|
33
|
+
xpath(%w[This-Assessment Electricity-CO2])&.to_i
|
34
34
|
end
|
35
35
|
|
36
36
|
def current_renewables_co2
|
37
|
-
xpath(%w[This-Assessment Renewables-CO2])
|
37
|
+
xpath(%w[This-Assessment Renewables-CO2])&.to_i
|
38
38
|
end
|
39
39
|
|
40
40
|
def year1_assessment_date
|
@@ -42,19 +42,19 @@ module ViewModel
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def year1_heating_co2
|
45
|
-
xpath(%w[Year1-Assessment Heating-CO2])
|
45
|
+
xpath(%w[Year1-Assessment Heating-CO2])&.to_i
|
46
46
|
end
|
47
47
|
|
48
48
|
def year1_electricity_co2
|
49
|
-
xpath(%w[Year1-Assessment Electricity-CO2])
|
49
|
+
xpath(%w[Year1-Assessment Electricity-CO2])&.to_i
|
50
50
|
end
|
51
51
|
|
52
52
|
def year1_renewables_co2
|
53
|
-
xpath(%w[Year1-Assessment Renewables-CO2])
|
53
|
+
xpath(%w[Year1-Assessment Renewables-CO2])&.to_i
|
54
54
|
end
|
55
55
|
|
56
56
|
def year1_energy_efficiency_rating
|
57
|
-
xpath(%w[Year1-Assessment Energy-Rating])
|
57
|
+
xpath(%w[Year1-Assessment Energy-Rating])&.to_i
|
58
58
|
end
|
59
59
|
|
60
60
|
def year2_assessment_date
|
@@ -62,15 +62,15 @@ module ViewModel
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def year2_heating_co2
|
65
|
-
xpath(%w[Year2-Assessment Heating-CO2])
|
65
|
+
xpath(%w[Year2-Assessment Heating-CO2])&.to_i
|
66
66
|
end
|
67
67
|
|
68
68
|
def year2_electricity_co2
|
69
|
-
xpath(%w[Year2-Assessment Electricity-CO2])
|
69
|
+
xpath(%w[Year2-Assessment Electricity-CO2])&.to_i
|
70
70
|
end
|
71
71
|
|
72
72
|
def year2_renewables_co2
|
73
|
-
xpath(%w[Year2-Assessment Renewables-CO2])
|
73
|
+
xpath(%w[Year2-Assessment Renewables-CO2])&.to_i
|
74
74
|
end
|
75
75
|
|
76
76
|
def special_energy_uses
|
@@ -78,7 +78,7 @@ module ViewModel
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def year2_energy_efficiency_rating
|
81
|
-
xpath(%w[Year2-Assessment Energy-Rating])
|
81
|
+
xpath(%w[Year2-Assessment Energy-Rating])&.to_i
|
82
82
|
end
|
83
83
|
|
84
84
|
def occupancy_level
|
@@ -98,7 +98,7 @@ module ViewModel
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def asset_rating
|
101
|
-
xpath(%w[OR-Previous-Data Asset-Rating])
|
101
|
+
xpath(%w[OR-Previous-Data Asset-Rating])&.to_i
|
102
102
|
end
|
103
103
|
|
104
104
|
def annual_energy_use_fuel_thermal
|
@@ -167,7 +167,7 @@ module ViewModel
|
|
167
167
|
consumption: xpath(%w[Consumption], node),
|
168
168
|
start_date: xpath(%w[Start-Date], node),
|
169
169
|
end_date: xpath(%w[End-Date], node),
|
170
|
-
estimate: xpath(%w[Estimate], node),
|
170
|
+
estimate: xpath(%w[Estimate], node)&.to_i,
|
171
171
|
name: node.name,
|
172
172
|
}
|
173
173
|
end
|
@@ -202,11 +202,11 @@ module ViewModel
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def ac_kw_rating
|
205
|
-
xpath(%w[AC-kW-Rating])
|
205
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
206
206
|
end
|
207
207
|
|
208
208
|
def estimated_ac_kw_rating
|
209
|
-
xpath(%w[AC-Estimated-Output])
|
209
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
210
210
|
end
|
211
211
|
|
212
212
|
def building_category
|
@@ -13,7 +13,7 @@ module ViewModel
|
|
13
13
|
nodes.filter_map do |node|
|
14
14
|
unless node.at("Text").content.nil? || node.at("Text").content.empty?
|
15
15
|
{
|
16
|
-
sequence: node.at("Seq-Number").content,
|
16
|
+
sequence: node.at("Seq-Number").content&.to_i,
|
17
17
|
text: node.at("Text").content,
|
18
18
|
}
|
19
19
|
end
|
@@ -6,7 +6,7 @@ module ViewModel
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def ac_kw_rating
|
9
|
-
xpath(%w[AC-kW-Rating])
|
9
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
10
10
|
end
|
11
11
|
|
12
12
|
def ac_present
|
@@ -22,11 +22,11 @@ module ViewModel
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def building_level
|
25
|
-
xpath(%w[Building-Level])
|
25
|
+
xpath(%w[Building-Level])&.to_i
|
26
26
|
end
|
27
27
|
|
28
28
|
def energy_efficiency_rating
|
29
|
-
xpath(%w[Asset-Rating])
|
29
|
+
xpath(%w[Asset-Rating])&.to_i
|
30
30
|
end
|
31
31
|
|
32
32
|
def epc_related_party_disclosure
|
@@ -34,11 +34,11 @@ module ViewModel
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def estimated_ac_kw_rating
|
37
|
-
xpath(%w[AC-Estimated-Output])
|
37
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
38
38
|
end
|
39
39
|
|
40
40
|
def existing_build_rating
|
41
|
-
xpath(%w[Existing-Stock-Benchmark])
|
41
|
+
xpath(%w[Existing-Stock-Benchmark])&.to_i
|
42
42
|
end
|
43
43
|
|
44
44
|
def floor_area
|
@@ -50,7 +50,7 @@ module ViewModel
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def new_build_rating
|
53
|
-
xpath(%w[New-Build-Benchmark])
|
53
|
+
xpath(%w[New-Build-Benchmark])&.to_i
|
54
54
|
end
|
55
55
|
|
56
56
|
def other_fuel_description
|
@@ -18,7 +18,7 @@ module ViewModel
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def energy_efficiency_rating
|
21
|
-
xpath(%w[This-Assessment Energy-Rating])
|
21
|
+
xpath(%w[This-Assessment Energy-Rating])&.to_i
|
22
22
|
end
|
23
23
|
|
24
24
|
def current_assessment_date
|
@@ -26,15 +26,15 @@ module ViewModel
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def current_heating_co2
|
29
|
-
xpath(%w[This-Assessment Heating-CO2])
|
29
|
+
xpath(%w[This-Assessment Heating-CO2])&.to_i
|
30
30
|
end
|
31
31
|
|
32
32
|
def current_electricity_co2
|
33
|
-
xpath(%w[This-Assessment Electricity-CO2])
|
33
|
+
xpath(%w[This-Assessment Electricity-CO2])&.to_i
|
34
34
|
end
|
35
35
|
|
36
36
|
def current_renewables_co2
|
37
|
-
xpath(%w[This-Assessment Renewables-CO2])
|
37
|
+
xpath(%w[This-Assessment Renewables-CO2])&.to_i
|
38
38
|
end
|
39
39
|
|
40
40
|
def year1_assessment_date
|
@@ -42,19 +42,19 @@ module ViewModel
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def year1_heating_co2
|
45
|
-
xpath(%w[Year1-Assessment Heating-CO2])
|
45
|
+
xpath(%w[Year1-Assessment Heating-CO2])&.to_i
|
46
46
|
end
|
47
47
|
|
48
48
|
def year1_electricity_co2
|
49
|
-
xpath(%w[Year1-Assessment Electricity-CO2])
|
49
|
+
xpath(%w[Year1-Assessment Electricity-CO2])&.to_i
|
50
50
|
end
|
51
51
|
|
52
52
|
def year1_renewables_co2
|
53
|
-
xpath(%w[Year1-Assessment Renewables-CO2])
|
53
|
+
xpath(%w[Year1-Assessment Renewables-CO2])&.to_i
|
54
54
|
end
|
55
55
|
|
56
56
|
def year1_energy_efficiency_rating
|
57
|
-
xpath(%w[Year1-Assessment Energy-Rating])
|
57
|
+
xpath(%w[Year1-Assessment Energy-Rating])&.to_i
|
58
58
|
end
|
59
59
|
|
60
60
|
def year2_assessment_date
|
@@ -62,15 +62,15 @@ module ViewModel
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def year2_heating_co2
|
65
|
-
xpath(%w[Year2-Assessment Heating-CO2])
|
65
|
+
xpath(%w[Year2-Assessment Heating-CO2])&.to_i
|
66
66
|
end
|
67
67
|
|
68
68
|
def year2_electricity_co2
|
69
|
-
xpath(%w[Year2-Assessment Electricity-CO2])
|
69
|
+
xpath(%w[Year2-Assessment Electricity-CO2])&.to_i
|
70
70
|
end
|
71
71
|
|
72
72
|
def year2_renewables_co2
|
73
|
-
xpath(%w[Year2-Assessment Renewables-CO2])
|
73
|
+
xpath(%w[Year2-Assessment Renewables-CO2])&.to_i
|
74
74
|
end
|
75
75
|
|
76
76
|
def special_energy_uses
|
@@ -78,7 +78,7 @@ module ViewModel
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def year2_energy_efficiency_rating
|
81
|
-
xpath(%w[Year2-Assessment Energy-Rating])
|
81
|
+
xpath(%w[Year2-Assessment Energy-Rating])&.to_i
|
82
82
|
end
|
83
83
|
|
84
84
|
def occupancy_level
|
@@ -98,7 +98,7 @@ module ViewModel
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def asset_rating
|
101
|
-
xpath(%w[OR-Previous-Data Asset-Rating])
|
101
|
+
xpath(%w[OR-Previous-Data Asset-Rating])&.to_i
|
102
102
|
end
|
103
103
|
|
104
104
|
def annual_energy_use_fuel_thermal
|
@@ -167,7 +167,7 @@ module ViewModel
|
|
167
167
|
consumption: xpath(%w[Consumption], node),
|
168
168
|
start_date: xpath(%w[Start-Date], node),
|
169
169
|
end_date: xpath(%w[End-Date], node),
|
170
|
-
estimate: xpath(%w[Estimate], node),
|
170
|
+
estimate: xpath(%w[Estimate], node)&.to_i,
|
171
171
|
name: node.name,
|
172
172
|
}
|
173
173
|
end
|
@@ -202,11 +202,11 @@ module ViewModel
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def ac_kw_rating
|
205
|
-
xpath(%w[AC-kW-Rating])
|
205
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
206
206
|
end
|
207
207
|
|
208
208
|
def estimated_ac_kw_rating
|
209
|
-
xpath(%w[AC-Estimated-Output])
|
209
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
210
210
|
end
|
211
211
|
|
212
212
|
def building_category
|
@@ -13,7 +13,7 @@ module ViewModel
|
|
13
13
|
nodes.filter_map do |node|
|
14
14
|
unless node.at("Text").content.nil? || node.at("Text").content.empty?
|
15
15
|
{
|
16
|
-
sequence: node.at("Seq-Number").content,
|
16
|
+
sequence: node.at("Seq-Number").content&.to_i,
|
17
17
|
text: node.at("Text").content,
|
18
18
|
}
|
19
19
|
end
|
@@ -6,7 +6,7 @@ module ViewModel
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def ac_kw_rating
|
9
|
-
xpath(%w[AC-kW-Rating])
|
9
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
10
10
|
end
|
11
11
|
|
12
12
|
def ac_present
|
@@ -22,7 +22,7 @@ module ViewModel
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def building_level
|
25
|
-
xpath(%w[Building-Level])
|
25
|
+
xpath(%w[Building-Level])&.to_i
|
26
26
|
end
|
27
27
|
|
28
28
|
def floor_area
|
@@ -30,7 +30,7 @@ module ViewModel
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def energy_efficiency_rating
|
33
|
-
xpath(%w[Asset-Rating])
|
33
|
+
xpath(%w[Asset-Rating])&.to_i
|
34
34
|
end
|
35
35
|
|
36
36
|
def epc_related_party_disclosure
|
@@ -38,11 +38,11 @@ module ViewModel
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def estimated_ac_kw_rating
|
41
|
-
xpath(%w[AC-Estimated-Output])
|
41
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
42
42
|
end
|
43
43
|
|
44
44
|
def existing_build_rating
|
45
|
-
xpath(%w[Existing-Stock-Benchmark])
|
45
|
+
xpath(%w[Existing-Stock-Benchmark])&.to_i
|
46
46
|
end
|
47
47
|
|
48
48
|
def main_heating_fuel
|
@@ -50,17 +50,13 @@ module ViewModel
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def new_build_rating
|
53
|
-
xpath(%w[New-Build-Benchmark])
|
53
|
+
xpath(%w[New-Build-Benchmark])&.to_i
|
54
54
|
end
|
55
55
|
|
56
56
|
def other_fuel_description
|
57
57
|
xpath(%w[Other-Fuel-Description])
|
58
58
|
end
|
59
59
|
|
60
|
-
def primary_energy_use
|
61
|
-
nil
|
62
|
-
end
|
63
|
-
|
64
60
|
def property_type
|
65
61
|
xpath(%w[Property-Type])
|
66
62
|
end
|
@@ -18,7 +18,7 @@ module ViewModel
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def energy_efficiency_rating
|
21
|
-
xpath(%w[This-Assessment Energy-Rating])
|
21
|
+
xpath(%w[This-Assessment Energy-Rating])&.to_i
|
22
22
|
end
|
23
23
|
|
24
24
|
def current_assessment_date
|
@@ -26,15 +26,15 @@ module ViewModel
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def current_heating_co2
|
29
|
-
xpath(%w[This-Assessment Heating-CO2])
|
29
|
+
xpath(%w[This-Assessment Heating-CO2])&.to_i
|
30
30
|
end
|
31
31
|
|
32
32
|
def current_electricity_co2
|
33
|
-
xpath(%w[This-Assessment Electricity-CO2])
|
33
|
+
xpath(%w[This-Assessment Electricity-CO2])&.to_i
|
34
34
|
end
|
35
35
|
|
36
36
|
def current_renewables_co2
|
37
|
-
xpath(%w[This-Assessment Renewables-CO2])
|
37
|
+
xpath(%w[This-Assessment Renewables-CO2])&.to_i
|
38
38
|
end
|
39
39
|
|
40
40
|
def year1_assessment_date
|
@@ -42,19 +42,19 @@ module ViewModel
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def year1_heating_co2
|
45
|
-
xpath(%w[Year1-Assessment Heating-CO2])
|
45
|
+
xpath(%w[Year1-Assessment Heating-CO2])&.to_i
|
46
46
|
end
|
47
47
|
|
48
48
|
def year1_electricity_co2
|
49
|
-
xpath(%w[Year1-Assessment Electricity-CO2])
|
49
|
+
xpath(%w[Year1-Assessment Electricity-CO2])&.to_i
|
50
50
|
end
|
51
51
|
|
52
52
|
def year1_renewables_co2
|
53
|
-
xpath(%w[Year1-Assessment Renewables-CO2])
|
53
|
+
xpath(%w[Year1-Assessment Renewables-CO2])&.to_i
|
54
54
|
end
|
55
55
|
|
56
56
|
def year1_energy_efficiency_rating
|
57
|
-
xpath(%w[Year1-Assessment Energy-Rating])
|
57
|
+
xpath(%w[Year1-Assessment Energy-Rating])&.to_i
|
58
58
|
end
|
59
59
|
|
60
60
|
def year2_assessment_date
|
@@ -62,19 +62,19 @@ module ViewModel
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def year2_heating_co2
|
65
|
-
xpath(%w[Year2-Assessment Heating-CO2])
|
65
|
+
xpath(%w[Year2-Assessment Heating-CO2])&.to_i
|
66
66
|
end
|
67
67
|
|
68
68
|
def year2_electricity_co2
|
69
|
-
xpath(%w[Year2-Assessment Electricity-CO2])
|
69
|
+
xpath(%w[Year2-Assessment Electricity-CO2])&.to_i
|
70
70
|
end
|
71
71
|
|
72
72
|
def year2_renewables_co2
|
73
|
-
xpath(%w[Year2-Assessment Renewables-CO2])
|
73
|
+
xpath(%w[Year2-Assessment Renewables-CO2])&.to_i
|
74
74
|
end
|
75
75
|
|
76
76
|
def year2_energy_efficiency_rating
|
77
|
-
xpath(%w[Year2-Assessment Energy-Rating])
|
77
|
+
xpath(%w[Year2-Assessment Energy-Rating])&.to_i
|
78
78
|
end
|
79
79
|
|
80
80
|
def main_heating_fuel
|
@@ -90,7 +90,7 @@ module ViewModel
|
|
90
90
|
end
|
91
91
|
|
92
92
|
def asset_rating
|
93
|
-
xpath(%w[OR-Previous-Data Asset-Rating])
|
93
|
+
xpath(%w[OR-Previous-Data Asset-Rating])&.to_i
|
94
94
|
end
|
95
95
|
|
96
96
|
def annual_energy_use_fuel_thermal
|
@@ -151,7 +151,7 @@ module ViewModel
|
|
151
151
|
.map do |node|
|
152
152
|
{
|
153
153
|
name: xpath(%w[Name], node),
|
154
|
-
id: xpath(%w[Benchmark-ID], node),
|
154
|
+
id: xpath(%w[Benchmark-ID], node)&.to_i,
|
155
155
|
tufa: xpath(%w[TUFA], node),
|
156
156
|
}
|
157
157
|
end
|
@@ -167,7 +167,7 @@ module ViewModel
|
|
167
167
|
consumption: xpath(%w[Consumption], node),
|
168
168
|
start_date: xpath(%w[Start-Date], node),
|
169
169
|
end_date: xpath(%w[End-Date], node),
|
170
|
-
estimate: xpath(%w[Estimate], node),
|
170
|
+
estimate: xpath(%w[Estimate], node)&.to_i,
|
171
171
|
name: node.name,
|
172
172
|
}
|
173
173
|
end
|
@@ -210,11 +210,11 @@ module ViewModel
|
|
210
210
|
end
|
211
211
|
|
212
212
|
def ac_kw_rating
|
213
|
-
xpath(%w[AC-kW-Rating])
|
213
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
214
214
|
end
|
215
215
|
|
216
216
|
def estimated_ac_kw_rating
|
217
|
-
xpath(%w[AC-Estimated-Output])
|
217
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
218
218
|
end
|
219
219
|
|
220
220
|
def building_category
|
@@ -21,7 +21,7 @@ module ViewModel
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def ac_rated_output
|
24
|
-
xpath(%w[AC-Rated-Output AC-kW-Rating])
|
24
|
+
xpath(%w[AC-Rated-Output AC-kW-Rating])&.to_i
|
25
25
|
end
|
26
26
|
|
27
27
|
def random_sampling
|
@@ -29,7 +29,7 @@ module ViewModel
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def treated_floor_area
|
32
|
-
xpath(%w[Air-Conditioning-Inspection-Certificate Treated-Floor-Area])
|
32
|
+
xpath(%w[Air-Conditioning-Inspection-Certificate Treated-Floor-Area])&.to_i
|
33
33
|
end
|
34
34
|
|
35
35
|
def ac_system_metered
|
@@ -41,7 +41,7 @@ module ViewModel
|
|
41
41
|
def refrigerant_charge
|
42
42
|
xpath(
|
43
43
|
%w[Air-Conditioning-Inspection-Certificate Refrigerant-Charge-Total],
|
44
|
-
)
|
44
|
+
)&.to_i
|
45
45
|
end
|
46
46
|
|
47
47
|
def related_rrn
|
@@ -13,7 +13,7 @@ module ViewModel
|
|
13
13
|
nodes.filter_map do |node|
|
14
14
|
unless node.at("Text").content.nil? || node.at("Text").content.empty?
|
15
15
|
{
|
16
|
-
sequence: node.at("Seq-Number").content,
|
16
|
+
sequence: node.at("Seq-Number").content&.to_i,
|
17
17
|
text: node.at("Text").content,
|
18
18
|
}
|
19
19
|
end
|
@@ -6,7 +6,7 @@ module ViewModel
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def ac_kw_rating
|
9
|
-
xpath(%w[AC-kW-Rating])
|
9
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
10
10
|
end
|
11
11
|
|
12
12
|
def ac_present
|
@@ -22,11 +22,11 @@ module ViewModel
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def building_level
|
25
|
-
xpath(%w[Building-Level])
|
25
|
+
xpath(%w[Building-Level])&.to_i
|
26
26
|
end
|
27
27
|
|
28
28
|
def energy_efficiency_rating
|
29
|
-
xpath(%w[Asset-Rating])
|
29
|
+
xpath(%w[Asset-Rating])&.to_i
|
30
30
|
end
|
31
31
|
|
32
32
|
def epc_related_party_disclosure
|
@@ -34,11 +34,11 @@ module ViewModel
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def estimated_ac_kw_rating
|
37
|
-
xpath(%w[AC-Estimated-Output])
|
37
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
38
38
|
end
|
39
39
|
|
40
40
|
def existing_build_rating
|
41
|
-
xpath(%w[Existing-Stock-Benchmark])
|
41
|
+
xpath(%w[Existing-Stock-Benchmark])&.to_i
|
42
42
|
end
|
43
43
|
|
44
44
|
def floor_area
|
@@ -50,17 +50,13 @@ module ViewModel
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def new_build_rating
|
53
|
-
xpath(%w[New-Build-Benchmark])
|
53
|
+
xpath(%w[New-Build-Benchmark])&.to_i
|
54
54
|
end
|
55
55
|
|
56
56
|
def other_fuel_description
|
57
57
|
xpath(%w[Other-Fuel-Description])
|
58
58
|
end
|
59
59
|
|
60
|
-
def primary_energy_use
|
61
|
-
nil
|
62
|
-
end
|
63
|
-
|
64
60
|
def property_type
|
65
61
|
xpath(%w[Property-Type])
|
66
62
|
end
|
@@ -18,7 +18,7 @@ module ViewModel
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def energy_efficiency_rating
|
21
|
-
xpath(%w[This-Assessment Energy-Rating])
|
21
|
+
xpath(%w[This-Assessment Energy-Rating])&.to_i
|
22
22
|
end
|
23
23
|
|
24
24
|
def current_assessment_date
|
@@ -26,15 +26,15 @@ module ViewModel
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def current_heating_co2
|
29
|
-
xpath(%w[This-Assessment Heating-CO2])
|
29
|
+
xpath(%w[This-Assessment Heating-CO2])&.to_i
|
30
30
|
end
|
31
31
|
|
32
32
|
def current_electricity_co2
|
33
|
-
xpath(%w[This-Assessment Electricity-CO2])
|
33
|
+
xpath(%w[This-Assessment Electricity-CO2])&.to_i
|
34
34
|
end
|
35
35
|
|
36
36
|
def current_renewables_co2
|
37
|
-
xpath(%w[This-Assessment Renewables-CO2])
|
37
|
+
xpath(%w[This-Assessment Renewables-CO2])&.to_i
|
38
38
|
end
|
39
39
|
|
40
40
|
def year1_assessment_date
|
@@ -42,19 +42,19 @@ module ViewModel
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def year1_heating_co2
|
45
|
-
xpath(%w[Year1-Assessment Heating-CO2])
|
45
|
+
xpath(%w[Year1-Assessment Heating-CO2])&.to_i
|
46
46
|
end
|
47
47
|
|
48
48
|
def year1_electricity_co2
|
49
|
-
xpath(%w[Year1-Assessment Electricity-CO2])
|
49
|
+
xpath(%w[Year1-Assessment Electricity-CO2])&.to_i
|
50
50
|
end
|
51
51
|
|
52
52
|
def year1_renewables_co2
|
53
|
-
xpath(%w[Year1-Assessment Renewables-CO2])
|
53
|
+
xpath(%w[Year1-Assessment Renewables-CO2])&.to_i
|
54
54
|
end
|
55
55
|
|
56
56
|
def year1_energy_efficiency_rating
|
57
|
-
xpath(%w[Year1-Assessment Energy-Rating])
|
57
|
+
xpath(%w[Year1-Assessment Energy-Rating])&.to_i
|
58
58
|
end
|
59
59
|
|
60
60
|
def year2_assessment_date
|
@@ -62,19 +62,19 @@ module ViewModel
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def year2_heating_co2
|
65
|
-
xpath(%w[Year2-Assessment Heating-CO2])
|
65
|
+
xpath(%w[Year2-Assessment Heating-CO2])&.to_i
|
66
66
|
end
|
67
67
|
|
68
68
|
def year2_electricity_co2
|
69
|
-
xpath(%w[Year2-Assessment Electricity-CO2])
|
69
|
+
xpath(%w[Year2-Assessment Electricity-CO2])&.to_i
|
70
70
|
end
|
71
71
|
|
72
72
|
def year2_renewables_co2
|
73
|
-
xpath(%w[Year2-Assessment Renewables-CO2])
|
73
|
+
xpath(%w[Year2-Assessment Renewables-CO2])&.to_i
|
74
74
|
end
|
75
75
|
|
76
76
|
def year2_energy_efficiency_rating
|
77
|
-
xpath(%w[Year2-Assessment Energy-Rating])
|
77
|
+
xpath(%w[Year2-Assessment Energy-Rating])&.to_i
|
78
78
|
end
|
79
79
|
|
80
80
|
def main_heating_fuel
|
@@ -98,7 +98,7 @@ module ViewModel
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def asset_rating
|
101
|
-
xpath(%w[OR-Previous-Data Asset-Rating])
|
101
|
+
xpath(%w[OR-Previous-Data Asset-Rating])&.to_i
|
102
102
|
end
|
103
103
|
|
104
104
|
def annual_energy_use_fuel_thermal
|
@@ -159,7 +159,7 @@ module ViewModel
|
|
159
159
|
.map do |node|
|
160
160
|
{
|
161
161
|
name: xpath(%w[Name], node),
|
162
|
-
id: xpath(%w[Benchmark-ID], node),
|
162
|
+
id: xpath(%w[Benchmark-ID], node)&.to_i,
|
163
163
|
tufa: xpath(%w[TUFA], node),
|
164
164
|
}
|
165
165
|
end
|
@@ -175,7 +175,7 @@ module ViewModel
|
|
175
175
|
consumption: xpath(%w[Consumption], node),
|
176
176
|
start_date: xpath(%w[Start-Date], node),
|
177
177
|
end_date: xpath(%w[End-Date], node),
|
178
|
-
estimate: xpath(%w[Estimate], node),
|
178
|
+
estimate: xpath(%w[Estimate], node)&.to_i,
|
179
179
|
name: node.name,
|
180
180
|
}
|
181
181
|
end
|
@@ -210,11 +210,11 @@ module ViewModel
|
|
210
210
|
end
|
211
211
|
|
212
212
|
def ac_kw_rating
|
213
|
-
xpath(%w[AC-kW-Rating])
|
213
|
+
xpath(%w[AC-kW-Rating])&.to_i
|
214
214
|
end
|
215
215
|
|
216
216
|
def estimated_ac_kw_rating
|
217
|
-
xpath(%w[AC-Estimated-Output])
|
217
|
+
xpath(%w[AC-Estimated-Output])&.to_i
|
218
218
|
end
|
219
219
|
|
220
220
|
def building_category
|