epb_view_models 2.2.13 → 2.2.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfad5c567761f739018096a595681262b5a09a126a8df371c284d2775f968181
4
- data.tar.gz: c404a439cae5c169165abc5932e740b9bbed47c9685f867190285b784866e5cd
3
+ metadata.gz: 75e967a3adf0402bc42780fee8db05794e1c5aec0bde4d5a06ab642d946def10
4
+ data.tar.gz: cca7f31cf0268b164d693f02b92e0cb129d6e09de0e61b44778ea7d656763a58
5
5
  SHA512:
6
- metadata.gz: d8b240543825514e005533874580ba28beb101bce383880ffda39dffa21585a39a923a1bc24558748cf0290a78889603491627245b812cb83ec68d4ee6052c29
7
- data.tar.gz: 69de0c2827d73b37b75ab93e669983d4cb3f50fec1aa1a880cc6fda73ddf22226943df643ad1452c007901874e1ce76e7ce87fa6f754ff8cdc5f7a4fe6ec28f2
6
+ metadata.gz: 05dd97560b0132e8cc85254611902bd46803590b75650a262724c072a503ebda5a4383dfb456aefcfbfcb96a0d3ab163a85c0f18e514ca8874796690047c0c68
7
+ data.tar.gz: d650e82077611f64bb5f518ce219ed308614e1a9c250b013e5d5294f58db3deadc1d4cd62836941d125a6f098a6d937f4326d69f98fa23e8fce5ec364bd39ad8
@@ -5,7 +5,7 @@ loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
5
5
  loader.setup
6
6
 
7
7
  module EpbViewModels
8
- VERSION = "2.2.13"
8
+ VERSION = "2.2.14"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -537,6 +537,8 @@ module ViewModel
537
537
  xpath(%w[SAP-Building-Part Party-Wall-Construction])
538
538
  end
539
539
 
540
+ # For lodgement rules
541
+
540
542
  def party_walls_construction
541
543
  @xml_doc
542
544
  .search("SAP-Building-Part")
@@ -553,12 +555,107 @@ module ViewModel
553
555
  alternative_wall_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness")&.content,
554
556
  alternative_wall_thickness_measured: node.at_xpath("SAP-Alternative-Wall/Wall-Thickness-Measured")&.content,
555
557
  alternative_wall_construction: node.at_xpath("SAP-Alternative-Wall/Wall-Construction")&.content,
558
+ alternative_wall_u_value: node.at_xpath("SAP-Alternative-Wall/Wall-U-Value")&.content,
559
+ alternative_wall_insulation_thickness: node.at_xpath("SAP-Alternative-Wall/Wall-Insulation-Thickness")&.content,
556
560
  wall_thickness: node.at_xpath("Wall-Thickness")&.content,
557
561
  wall_construction: node.at_xpath("Wall-Construction")&.content,
558
562
  wall_thickness_measured: node.at_xpath("Wall-Thickness-Measured")&.content,
559
563
  }
560
564
  end
561
565
  end
566
+
567
+ def rooves_construction_and_insulation
568
+ @xml_doc
569
+ .search("SAP-Building-Part")
570
+ .map do |node|
571
+ {
572
+ roof_insulation_location: node.at_xpath("Roof-Insulation-Location")&.content,
573
+ roof_construction: node.at_xpath("Roof-Construction")&.content,
574
+ }
575
+ end
576
+ end
577
+
578
+ def rooms_in_roof_insulation
579
+ @xml_doc
580
+ .search("SAP-Building-Part")
581
+ .map do |node|
582
+ xpath(%w[SAP-Room-In-Roof Insulation])
583
+ end
584
+ end
585
+
586
+ def floors_insulation
587
+ @xml_doc
588
+ .search("SAP-Building-Part")
589
+ .map do |node|
590
+ {
591
+ floor_u_value: node.at_xpath("Floor-U-Value")&.content,
592
+ floor_insulation_thickness: node.at_xpath("Floor-Insulation-Thickness")&.content,
593
+ }
594
+ end
595
+ end
596
+
597
+ def rooves_insulation
598
+ @xml_doc
599
+ .search("SAP-Building-Part")
600
+ .map do |node|
601
+ {
602
+ roof_u_value: node.at_xpath("Roof-U-Value")&.content,
603
+ roof_insulation_thickness: node.at_xpath("Roof-Insulation-Thickness")&.content,
604
+ rafter_insulation_thickness: node.at_xpath("Rafter-Insulation-Thickness")&.content,
605
+ flat_roof_insulation_thickness: node.at_xpath("Flat-Roof-Insulation-Thickness")&.content,
606
+ sloping_ceiling_insulation_thickness: node.at_xpath("Sloping-Ceiling-Insulation-Thickness")&.content,
607
+ }
608
+ end
609
+ end
610
+
611
+ def walls_insulation
612
+ @xml_doc
613
+ .search("SAP-Building-Part")
614
+ .map do |node|
615
+ {
616
+ wall_u_value: node.at_xpath("Wall-U-Value")&.content,
617
+ wall_insulation_thickness: node.at_xpath("Wall-Insulation-Thickness")&.content,
618
+ }
619
+ end
620
+ end
621
+
622
+ def rooms_in_roof
623
+ @xml_doc
624
+ .search("SAP-Building-Part")
625
+ .map do |node|
626
+ node.at_xpath("SAP-Room-In-Roof")&.content.to_s
627
+ end
628
+ end
629
+
630
+ def rooms_in_roof_roof_insulation
631
+ @xml_doc
632
+ .search("SAP-Building-Part")
633
+ .map do |node|
634
+ {
635
+ roof_insulation_thickness: xpath(%w[SAP-Room-In-Roof Roof-Insulation-Thickness]),
636
+ room_in_roof_details: xpath(%w[SAP-Room-In-Roof Room-In-Roof-Details]),
637
+ }
638
+ end
639
+ end
640
+
641
+ def main_heating_details
642
+ @xml_doc
643
+ .search("Main-Heating")
644
+ .map do |node|
645
+ {
646
+ main_heating_index_number: xpath(%w[Main-Heating-Index-Number]),
647
+ sap_main_heating_code: xpath(%w[SAP-Main-Heating-Code]),
648
+ main_fuel_type: xpath(%w[Main-Fuel-Type]),
649
+ }
650
+ end
651
+ end
652
+
653
+ def water_heating
654
+ {
655
+ water_heating_fuel: xpath(%w[Water-Heating-Fuel]),
656
+ water_heating_code: xpath(%w[Water-Heating-Code]),
657
+ }
658
+ end
562
659
  end
563
660
  end
564
661
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epb_view_models
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.13
4
+ version: 2.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - MHCLG Energy Performance of Buildings