epb_view_models 2.0.18 → 2.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/epb_view_models.rb +1 -1
- data/lib/view_model/cepc_s_71/cepc.rb +1 -1
- data/lib/view_model/rd_sap_schema_210/common_schema.rb +33 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9907c3bbfc0deee1802164bdb0be33ff7b1a72d6158962b9a7d647b4d70b3cd7
|
4
|
+
data.tar.gz: 49b6df150a4c8ea0e5e88b68ffdacf4e93a62ddd7b12f01d6f245057056d5b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e68bbb919f2eef1f852726f496d9c119763598dc94a8cdef7524364b375acfd8b5664c48bb8409e7a1dc25ed05758cd887976108a50c1c4858a952cda1762b7
|
7
|
+
data.tar.gz: 0a4381990244e6796e7a1bb8b9671cdc820582b0b0c81569f4cebaabddda9426decc7dfe79095fad618b89c49a575b4b1dd200837e8162a8e850f9d41a661313
|
data/lib/epb_view_models.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
module ViewModel
|
2
2
|
module CepcS71
|
3
3
|
class Cepc < ViewModel::Cepc71::CommonSchema
|
4
|
-
|
5
4
|
def date_of_expiry
|
6
5
|
expires_at = (Date.parse(date_of_registration) - 1) >> 12 * 10
|
7
6
|
|
8
7
|
expires_at.to_s
|
9
8
|
end
|
9
|
+
|
10
10
|
def ac_inspection_commissioned
|
11
11
|
xpath(%w[AC-Inspection-Commissioned])
|
12
12
|
end
|
@@ -125,8 +125,8 @@ module ViewModel
|
|
125
125
|
{
|
126
126
|
sequence: xpath(%w[Sequence], node).to_i,
|
127
127
|
improvement_code: xpath(%w[Improvement-Details Improvement-Number], node),
|
128
|
-
improvement_summary: improvement_code ? accessor.fetch_details(schema_version: "RdSAP-Schema-
|
129
|
-
improvement_description: improvement_code ? accessor.fetch_details(schema_version: "RdSAP-Schema-
|
128
|
+
improvement_summary: improvement_code ? accessor.fetch_details(schema_version: "RdSAP-Schema-21.0.0", improvement_number: improvement_code).summary : xpath(%w[Improvement-Summary], node),
|
129
|
+
improvement_description: improvement_code ? accessor.fetch_details(schema_version: "RdSAP-Schema-21.0.0", improvement_number: improvement_code).description : xpath(%w[Improvement-Description], node),
|
130
130
|
indicative_cost: xpath(%w[Indicative-Cost], node),
|
131
131
|
}
|
132
132
|
end
|
@@ -397,6 +397,37 @@ module ViewModel
|
|
397
397
|
xpath(%w[Heated-Room-Count])&.to_i
|
398
398
|
end
|
399
399
|
|
400
|
+
def low_energy_lighting
|
401
|
+
(low_energy_fixed_lighting_outlets_count / fixed_lighting_outlets_count) * 100
|
402
|
+
end
|
403
|
+
|
404
|
+
def fixed_lighting_outlets_count
|
405
|
+
fixed_lighting_outlets_count = low_energy_fixed_lighting_outlets_count
|
406
|
+
if xpath(%w[Incandescent-Lighting-Bulbs-Count])
|
407
|
+
fixed_lighting_outlets_count += xpath(%w[Incandescent-Lighting-Bulbs-Count])&.to_i
|
408
|
+
end
|
409
|
+
fixed_lighting_outlets_count
|
410
|
+
end
|
411
|
+
|
412
|
+
def low_energy_fixed_lighting_outlets_count
|
413
|
+
low_energy_fixed_lighting_outlets_count = 0
|
414
|
+
if xpath(%w[CFL-Fixed-Lighting-Bulbs-Count])
|
415
|
+
low_energy_fixed_lighting_outlets_count += xpath(%w[CFL-Fixed-Lighting-Bulbs-Count])&.to_i
|
416
|
+
end
|
417
|
+
if xpath(%w[LED-Fixed-Lighting-Bulbs-Count])
|
418
|
+
low_energy_fixed_lighting_outlets_count += xpath(%w[LED-Fixed-Lighting-Bulbs-Count])&.to_i
|
419
|
+
end
|
420
|
+
if xpath(%w[Low-Energy-Fixed-Lighting-Bulbs-Count])
|
421
|
+
low_energy_fixed_lighting_outlets_count += xpath(%w[Low-Energy-Fixed-Lighting-Bulbs-Count])&.to_i
|
422
|
+
end
|
423
|
+
|
424
|
+
low_energy_fixed_lighting_outlets_count
|
425
|
+
end
|
426
|
+
|
427
|
+
def open_fireplaces_count
|
428
|
+
xpath(%w[Open-Chimneys-Count])&.to_i
|
429
|
+
end
|
430
|
+
|
400
431
|
def hot_water_description
|
401
432
|
xpath(%w[Hot-Water Description])
|
402
433
|
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: 2.0.
|
4
|
+
version: 2.0.20
|
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: 2025-
|
11
|
+
date: 2025-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|