Class: ViewModel::Cepc71::CommonSchema

Inherits:
BaseViewModel show all
Defined in:
lib/view_model/cepc71/common_schema.rb

Direct Known Subclasses

AcCert, AcReport, Cepc, CepcRr, Dec, DecRr

Instance Method Summary collapse

Methods inherited from BaseViewModel

#initialize, #xpath

Constructor Details

This class inherits a constructor from ViewModel::BaseViewModel

Instance Method Details

#address_idObject



76
77
78
# File 'lib/view_model/cepc71/common_schema.rb', line 76

def address_id
  "LPRN-#{xpath(%w[UPRN])}"
end

#address_line1Object



16
17
18
# File 'lib/view_model/cepc71/common_schema.rb', line 16

def address_line1
  xpath(%w[Property-Address Address-Line-1])
end

#address_line2Object



20
21
22
# File 'lib/view_model/cepc71/common_schema.rb', line 20

def address_line2
  xpath(%w[Property-Address Address-Line-2])
end

#address_line3Object



24
25
26
# File 'lib/view_model/cepc71/common_schema.rb', line 24

def address_line3
  xpath(%w[Property-Address Address-Line-3])
end

#address_line4Object



28
29
30
# File 'lib/view_model/cepc71/common_schema.rb', line 28

def address_line4
  xpath(%w[Property-Address Address-Line-4])
end

#all_energy_typesObject



84
85
86
# File 'lib/view_model/cepc71/common_schema.rb', line 84

def all_energy_types
  @xml_doc.search("Energy-Type").map(&:content)
end

#all_reason_typesObject



88
89
90
# File 'lib/view_model/cepc71/common_schema.rb', line 88

def all_reason_types
  @xml_doc.search("Reason-Type").map(&:content)
end

#all_start_datesObject



80
81
82
# File 'lib/view_model/cepc71/common_schema.rb', line 80

def all_start_dates
  @xml_doc.search("Start-Date").map(&:content)
end

#assessment_idObject



4
5
6
# File 'lib/view_model/cepc71/common_schema.rb', line 4

def assessment_id
  xpath(%w[RRN])
end

#assessor_emailObject



48
49
50
# File 'lib/view_model/cepc71/common_schema.rb', line 48

def assessor_email
  xpath(%w[Energy-Assessor E-Mail])
end

#assessor_nameObject



44
45
46
# File 'lib/view_model/cepc71/common_schema.rb', line 44

def assessor_name
  xpath(%w[Energy-Assessor Name])
end

#assessor_telephoneObject



52
53
54
# File 'lib/view_model/cepc71/common_schema.rb', line 52

def assessor_telephone
  xpath(%w[Energy-Assessor Telephone-Number])
end

#building_levelObject



104
105
106
# File 'lib/view_model/cepc71/common_schema.rb', line 104

def building_level
  xpath(%w[Building-Level])&.to_i
end

#calculation_toolObject



96
97
98
# File 'lib/view_model/cepc71/common_schema.rb', line 96

def calculation_tool
  xpath(%w[Calculation-Details Calculation-Tool])
end

#company_addressObject



60
61
62
# File 'lib/view_model/cepc71/common_schema.rb', line 60

def company_address
  xpath(%w[Energy-Assessor Trading-Address])
end

#company_nameObject



56
57
58
# File 'lib/view_model/cepc71/common_schema.rb', line 56

def company_name
  xpath(%w[Energy-Assessor Company-Name])
end

#date_of_assessmentObject



64
65
66
# File 'lib/view_model/cepc71/common_schema.rb', line 64

def date_of_assessment
  xpath(%w[Inspection-Date])
end

#date_of_expiryObject



8
9
10
# File 'lib/view_model/cepc71/common_schema.rb', line 8

def date_of_expiry
  xpath(%w[Valid-Until])
end

#date_of_issueObject



72
73
74
# File 'lib/view_model/cepc71/common_schema.rb', line 72

def date_of_issue
  xpath(%w[Issue-Date])
end

#date_of_registrationObject



68
69
70
# File 'lib/view_model/cepc71/common_schema.rb', line 68

def date_of_registration
  xpath(%w[Registration-Date])
end

#inspection_typeObject



100
101
102
# File 'lib/view_model/cepc71/common_schema.rb', line 100

def inspection_type
  xpath(%w[Calculation-Details Inspection-Type])
end

#or_assessment_end_dateObject



92
93
94
# File 'lib/view_model/cepc71/common_schema.rb', line 92

def or_assessment_end_date
  xpath(%w[OR-Operational-Rating OR-Assessment-End-Date])
end

#postcodeObject



36
37
38
# File 'lib/view_model/cepc71/common_schema.rb', line 36

def postcode
  xpath(%w[Property-Address Postcode])
end

#report_typeObject



12
13
14
# File 'lib/view_model/cepc71/common_schema.rb', line 12

def report_type
  xpath(%w[Report-Type])
end

#scheme_assessor_idObject



40
41
42
# File 'lib/view_model/cepc71/common_schema.rb', line 40

def scheme_assessor_id
  xpath(%w[Certificate-Number])
end

#townObject



32
33
34
# File 'lib/view_model/cepc71/common_schema.rb', line 32

def town
  xpath(%w[Property-Address Post-Town])
end