Class: ViewModel::Cepc50::CepcRr
Instance Method Summary
collapse
#address_id, #address_line1, #address_line2, #address_line3, #address_line4, #all_energy_types, #all_reason_types, #all_start_dates, #assessment_id, #assessor_email, #assessor_name, #assessor_telephone, #building_level, #calculation_tool, #company_address, #company_name, #date_of_assessment, #date_of_expiry, #date_of_issue, #date_of_registration, #inspection_type, #or_assessment_end_date, #postcode, #report_type, #scheme_assessor_id, #town
#initialize, #xpath
Instance Method Details
#building_environment ⇒ Object
41
42
43
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 41
def building_environment
xpath(%w[Building-Environment])
end
|
45
46
47
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 45
def calculation_tools
xpath(%w[Calculation-Tool])
end
|
#floor_area ⇒ Object
37
38
39
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 37
def floor_area
xpath(%w[Technical-Information Floor-Area])
end
|
#long_payback_recommendations ⇒ Object
29
30
31
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 29
def long_payback_recommendations
recommendations("Long-Payback")
end
|
#medium_payback_recommendations ⇒ Object
25
26
27
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 25
def medium_payback_recommendations
recommendations("Medium-Payback")
end
|
#other_recommendations ⇒ Object
33
34
35
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 33
def other_recommendations
recommendations("Other-Payback")
end
|
#recommendations(payback = "") ⇒ Object
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 4
def recommendations(payback = "")
if payback.empty?
@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
|
49
50
51
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 49
def related_certificate
xpath(%w[Related-RRN])
end
|
53
54
55
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 53
def related_party_disclosure
xpath(%w[Related-Party-Disclosure])
end
|
#short_payback_recommendations ⇒ Object
21
22
23
|
# File 'lib/view_model/cepc50/cepc_rr.rb', line 21
def short_payback_recommendations
recommendations("Short-Payback")
end
|