Class: ViewModel::Cepc800::CommonSchema
Instance Method Summary
collapse
#initialize, #xpath
Instance Method Details
#address_id ⇒ Object
76
77
78
|
# File 'lib/view_model/cepc800/common_schema.rb', line 76
def address_id
xpath(%w[UPRN])
end
|
#address_line1 ⇒ Object
16
17
18
|
# File 'lib/view_model/cepc800/common_schema.rb', line 16
def address_line1
xpath(%w[Property-Address Address-Line-1])
end
|
#address_line2 ⇒ Object
20
21
22
|
# File 'lib/view_model/cepc800/common_schema.rb', line 20
def address_line2
xpath(%w[Property-Address Address-Line-2])
end
|
#address_line3 ⇒ Object
24
25
26
|
# File 'lib/view_model/cepc800/common_schema.rb', line 24
def address_line3
xpath(%w[Property-Address Address-Line-3])
end
|
#address_line4 ⇒ Object
28
29
30
|
# File 'lib/view_model/cepc800/common_schema.rb', line 28
def address_line4
xpath(%w[Property-Address Address-Line-4])
end
|
#all_energy_types ⇒ Object
84
85
86
|
# File 'lib/view_model/cepc800/common_schema.rb', line 84
def all_energy_types
@xml_doc.search("Energy-Type").map(&:content)
end
|
#all_reason_types ⇒ Object
88
89
90
|
# File 'lib/view_model/cepc800/common_schema.rb', line 88
def all_reason_types
@xml_doc.search("Reason-Type").map(&:content)
end
|
#all_start_dates ⇒ Object
80
81
82
|
# File 'lib/view_model/cepc800/common_schema.rb', line 80
def all_start_dates
@xml_doc.search("Start-Date").map(&:content)
end
|
#assessment_id ⇒ Object
4
5
6
|
# File 'lib/view_model/cepc800/common_schema.rb', line 4
def assessment_id
xpath(%w[RRN])
end
|
#assessor_email ⇒ Object
48
49
50
|
# File 'lib/view_model/cepc800/common_schema.rb', line 48
def assessor_email
xpath(%w[Energy-Assessor E-Mail])
end
|
#assessor_name ⇒ Object
44
45
46
|
# File 'lib/view_model/cepc800/common_schema.rb', line 44
def assessor_name
xpath(%w[Energy-Assessor Name])
end
|
#assessor_telephone ⇒ Object
52
53
54
|
# File 'lib/view_model/cepc800/common_schema.rb', line 52
def assessor_telephone
xpath(%w[Energy-Assessor Telephone-Number])
end
|
#building_level ⇒ Object
104
105
106
|
# File 'lib/view_model/cepc800/common_schema.rb', line 104
def building_level
xpath(%w[Building-Level])&.to_i
end
|
96
97
98
|
# File 'lib/view_model/cepc800/common_schema.rb', line 96
def calculation_tool
xpath(%w[Calculation-Details Calculation-Tool])
end
|
#company_address ⇒ Object
60
61
62
|
# File 'lib/view_model/cepc800/common_schema.rb', line 60
def company_address
xpath(%w[Energy-Assessor Trading-Address])
end
|
#company_name ⇒ Object
56
57
58
|
# File 'lib/view_model/cepc800/common_schema.rb', line 56
def company_name
xpath(%w[Energy-Assessor Company-Name])
end
|
#date_of_assessment ⇒ Object
64
65
66
|
# File 'lib/view_model/cepc800/common_schema.rb', line 64
def date_of_assessment
xpath(%w[Inspection-Date])
end
|
#date_of_expiry ⇒ Object
8
9
10
|
# File 'lib/view_model/cepc800/common_schema.rb', line 8
def date_of_expiry
xpath(%w[Valid-Until])
end
|
#date_of_issue ⇒ Object
72
73
74
|
# File 'lib/view_model/cepc800/common_schema.rb', line 72
def date_of_issue
xpath(%w[Issue-Date])
end
|
#date_of_registration ⇒ Object
68
69
70
|
# File 'lib/view_model/cepc800/common_schema.rb', line 68
def date_of_registration
xpath(%w[Registration-Date])
end
|
#inspection_type ⇒ Object
100
101
102
|
# File 'lib/view_model/cepc800/common_schema.rb', line 100
def inspection_type
xpath(%w[Calculation-Details Inspection-Type])
end
|
#or_assessment_end_date ⇒ Object
92
93
94
|
# File 'lib/view_model/cepc800/common_schema.rb', line 92
def or_assessment_end_date
xpath(%w[OR-Operational-Rating OR-Assessment-End-Date])
end
|
#postcode ⇒ Object
36
37
38
|
# File 'lib/view_model/cepc800/common_schema.rb', line 36
def postcode
xpath(%w[Property-Address Postcode])
end
|
#report_type ⇒ Object
12
13
14
|
# File 'lib/view_model/cepc800/common_schema.rb', line 12
def report_type
xpath(%w[Report-Type])
end
|
#scheme_assessor_id ⇒ Object
40
41
42
|
# File 'lib/view_model/cepc800/common_schema.rb', line 40
def scheme_assessor_id
xpath(%w[Certificate-Number])
end
|
#town ⇒ Object
32
33
34
|
# File 'lib/view_model/cepc800/common_schema.rb', line 32
def town
xpath(%w[Property-Address Post-Town])
end
|