epb_view_models 1.2.1 → 1.2.2

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: 69842d75696d6f7e922b3b3d93c4301da15017f63ecfac51eeddcbe0dc10ba81
4
- data.tar.gz: 0337bc45cffd6c0b3d61f7eb6e1c759597395b7c40c7187c6f7e274c9e25f22c
3
+ metadata.gz: 57c41aeb5139992344e4f24f10c3d228ed16be53897797385772e072058ced42
4
+ data.tar.gz: 4cf9250ab8506ba2d1e3fe12cbf941bb08fab056566817ecdf39197d827c50b1
5
5
  SHA512:
6
- metadata.gz: de4ef827342f795a028984f6be18a36b99ebc07eff4aedeb8f72bf3a16a115e21fc22ec1b0e8fff66ca7d43f55904b157d6cbf4697854246691a7608cb959c46
7
- data.tar.gz: cc548ce387bf14fcd410311c19e37fbe23ad1cabc54a75494649fe476ef200effcb27843de97bd840d4ef134624c00c263a1d200d905d68124677496bd36cbd0
6
+ metadata.gz: 7dc0258c499b17ebca6f2e9d36bb963d359c6a9ca07cbfdd4644c4e1d2db6315248b449841abe7694a1b8a050a27d7795e15773c9cc983f0e65bc10156c00f30
7
+ data.tar.gz: a6c60a5dac44e2a9e7df2484cc228cff56298a118820f3763ffc0137f20962fac9b00f0dd07f21b9f2b1e658b3abc07338774b7959001083c7fb6ad7d607f7a8
@@ -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 = "1.2.1"
8
+ VERSION = "1.2.2"
9
9
  end
10
10
 
11
11
  # Monkey patching to avoid using ActiveRecord::Type::Boolean.new.cast
@@ -0,0 +1,12 @@
1
+ module Helper
2
+ class ToBool
3
+ def self.execute(string)
4
+ case string
5
+ when "true"
6
+ true
7
+ when "false"
8
+ false
9
+ end
10
+ end
11
+ end
12
+ end
@@ -584,11 +584,11 @@ module ViewModel
584
584
  end
585
585
 
586
586
  def gas_smart_meter_present
587
- xpath(%w[Gas-Smart-Meter-Present])
587
+ Helper::ToBool.execute(xpath(%w[Gas-Smart-Meter-Present]))
588
588
  end
589
589
 
590
590
  def electricity_smart_meter_present
591
- xpath(%w[Electricity-Smart-Meter-Present])
591
+ Helper::ToBool.execute(xpath(%w[Electricity-Smart-Meter-Present]))
592
592
  end
593
593
  end
594
594
  end
@@ -629,11 +629,11 @@ module ViewModel
629
629
  end
630
630
 
631
631
  def gas_smart_meter_present
632
- xpath(%w[Gas-Smart-Meter-Present])
632
+ Helper::ToBool.execute(xpath(%w[Gas-Smart-Meter-Present]))
633
633
  end
634
634
 
635
635
  def electricity_smart_meter_present
636
- xpath(%w[Electricity-Smart-Meter-Present])
636
+ Helper::ToBool.execute(xpath(%w[Electricity-Smart-Meter-Present]))
637
637
  end
638
638
  end
639
639
  end
@@ -629,11 +629,11 @@ module ViewModel
629
629
  end
630
630
 
631
631
  def gas_smart_meter_present
632
- xpath(%w[Gas-Smart-Meter-Present])
632
+ Helper::ToBool.execute(xpath(%w[Gas-Smart-Meter-Present]))
633
633
  end
634
634
 
635
635
  def electricity_smart_meter_present
636
- xpath(%w[Electricity-Smart-Meter-Present])
636
+ Helper::ToBool.execute(xpath(%w[Electricity-Smart-Meter-Present]))
637
637
  end
638
638
  end
639
639
  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: 1.2.1
4
+ version: 1.2.2
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-02-23 00:00:00.000000000 Z
11
+ date: 2024-02-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -1674,6 +1674,7 @@ files:
1674
1674
  - lib/helper/estimated_cost_potential_saving_helper.rb
1675
1675
  - lib/helper/rrn_helper.rb
1676
1676
  - lib/helper/schema_list_helper.rb
1677
+ - lib/helper/to_bool.rb
1677
1678
  - lib/helper/xml_enums_to_output.rb
1678
1679
  - lib/presenter/ac_cert/export_configuration.rb
1679
1680
  - lib/presenter/ac_cert/summary.rb