class ViewModel::Cepc31::CepcRr

Public Instance Methods

building_environment() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 41
def building_environment
  xpath(%w[Building-Environment])
end
calculation_tools() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 45
def calculation_tools
  xpath(%w[Calculation-Tool])
end
floor_area() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 37
def floor_area
  xpath(%w[Technical-Information Floor-Area])
end
long_payback_recommendations() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 29
def long_payback_recommendations
  recommendations("Long-Payback")
end
medium_payback_recommendations() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 25
def medium_payback_recommendations
  recommendations("Medium-Payback")
end
other_recommendations() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 33
def other_recommendations
  recommendations("Other-Payback")
end
recommendations(payback = "") click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 4
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
short_payback_recommendations() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 21
def short_payback_recommendations
  recommendations("Short-Payback")
end
special_energy_uses() click to toggle source
# File lib/view_model/cepc31/cepc_rr.rb, line 57
def special_energy_uses
  xpath(%w[Special-Energy-Uses])
end