Sha256: 2a1d0fddfcc33e84d3c3df68ada5c42b1be0bcf1ad47c20580d43ea915cff6e5
Contents?: true
Size: 1.43 KB
Versions: 47
Compression:
Stored size: 1.43 KB
Contents
module ViewModel module Cepc31 class CepcRr < ViewModel::Cepc31::CommonSchema def recommendations(payback = "") if payback.empty? # return an enumerable of all nodes @xml_doc.xpath "RR-Recommendations" else @xml_doc .search("RR-Recommendations/#{payback}") .map do |node| { code: node.at("Recommendation-Code").content, text: node.at("Recommendation").content, cO2Impact: node.at("CO2-Impact").content, } end end end def short_payback_recommendations recommendations("Short-Payback") end def medium_payback_recommendations recommendations("Medium-Payback") end def long_payback_recommendations recommendations("Long-Payback") end def other_recommendations recommendations("Other-Payback") end def floor_area xpath(%w[Technical-Information Floor-Area]) end def building_environment xpath(%w[Building-Environment]) end def calculation_tools xpath(%w[Calculation-Tool]) end def related_certificate xpath(%w[Related-RRN]) end def related_party_disclosure xpath(%w[Related-Party-Disclosure]) end def special_energy_uses xpath(%w[Special-Energy-Uses]) end end end end
Version data entries
47 entries across 47 versions & 1 rubygems