Class: ViewModel::CepcS71::Cepc

Inherits:
ViewModel::Cepc71::CommonSchema show all
Defined in:
lib/view_model/cepc_s_71/cepc.rb

Instance Method Summary collapse

Methods inherited from ViewModel::Cepc71::CommonSchema

#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, #calculation_tool, #company_address, #company_name, #date_of_assessment, #date_of_issue, #date_of_registration, #inspection_type, #or_assessment_end_date, #postcode, #report_type, #scheme_assessor_id, #town

Methods inherited from BaseViewModel

#initialize, #xpath

Constructor Details

This class inherits a constructor from ViewModel::BaseViewModel

Instance Method Details

#ac_inspection_commissionedObject



10
11
12
# File 'lib/view_model/cepc_s_71/cepc.rb', line 10

def ac_inspection_commissioned
  xpath(%w[AC-Inspection-Commissioned])
end

#ac_kw_ratingObject



14
15
16
# File 'lib/view_model/cepc_s_71/cepc.rb', line 14

def ac_kw_rating
  xpath(%w[AC-kW-Rating])&.to_i
end

#ac_presentObject



18
19
20
# File 'lib/view_model/cepc_s_71/cepc.rb', line 18

def ac_present
  xpath(%w[AC-Present])
end

#ac_rated_outputObject



22
23
24
# File 'lib/view_model/cepc_s_71/cepc.rb', line 22

def ac_rated_output
  xpath(%w[AC-Rated-Output])
end

#building_emission_rateObject



26
27
28
# File 'lib/view_model/cepc_s_71/cepc.rb', line 26

def building_emission_rate
  xpath(%w[BER])
end

#building_environmentObject



30
31
32
# File 'lib/view_model/cepc_s_71/cepc.rb', line 30

def building_environment
  xpath(%w[Building-Environment])
end

#building_levelObject



34
35
36
# File 'lib/view_model/cepc_s_71/cepc.rb', line 34

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

#date_of_expiryObject



4
5
6
7
8
# File 'lib/view_model/cepc_s_71/cepc.rb', line 4

def date_of_expiry
  expires_at = (Date.parse(date_of_registration) - 1) >> 12 * 10

  expires_at.to_s
end

#energy_efficiency_ratingObject



38
39
40
# File 'lib/view_model/cepc_s_71/cepc.rb', line 38

def energy_efficiency_rating
  xpath(%w[Asset-Rating])&.to_i
end


42
43
44
# File 'lib/view_model/cepc_s_71/cepc.rb', line 42

def epc_related_party_disclosure
  xpath(%w[EPC-Related-Party-Disclosure])
end

#estimated_ac_kw_ratingObject



46
47
48
# File 'lib/view_model/cepc_s_71/cepc.rb', line 46

def estimated_ac_kw_rating
  xpath(%w[AC-Estimated-Output])&.to_i
end

#existing_build_ratingObject



50
51
52
# File 'lib/view_model/cepc_s_71/cepc.rb', line 50

def existing_build_rating
  xpath(%w[Existing-Stock-Benchmark])&.to_i
end

#floor_areaObject



54
55
56
# File 'lib/view_model/cepc_s_71/cepc.rb', line 54

def floor_area
  xpath(%w[Technical-Information Floor-Area])
end

#main_heating_fuelObject



58
59
60
# File 'lib/view_model/cepc_s_71/cepc.rb', line 58

def main_heating_fuel
  xpath(%w[Main-Heating-Fuel])
end

#new_build_ratingObject



62
63
64
# File 'lib/view_model/cepc_s_71/cepc.rb', line 62

def new_build_rating
  xpath(%w[New-Build-Benchmark])&.to_i
end

#other_fuel_descriptionObject



66
67
68
# File 'lib/view_model/cepc_s_71/cepc.rb', line 66

def other_fuel_description
  xpath(%w[Other-Fuel-Description])
end

#primary_energy_useObject



70
71
72
# File 'lib/view_model/cepc_s_71/cepc.rb', line 70

def primary_energy_use
  xpath(%w[Energy-Consumption-Current])
end

#property_typeObject



74
75
76
# File 'lib/view_model/cepc_s_71/cepc.rb', line 74

def property_type
  xpath(%w[Property-Type])
end


78
79
80
# File 'lib/view_model/cepc_s_71/cepc.rb', line 78

def related_rrn
  xpath(%w[Related-RRN])
end

#renewable_sourcesObject



102
103
104
# File 'lib/view_model/cepc_s_71/cepc.rb', line 102

def renewable_sources
  xpath(%w[Renewable-Sources])
end

#special_energy_usesObject



82
83
84
# File 'lib/view_model/cepc_s_71/cepc.rb', line 82

def special_energy_uses
  xpath(%w[Special-Energy-Uses])
end

#standard_emissionsObject



86
87
88
# File 'lib/view_model/cepc_s_71/cepc.rb', line 86

def standard_emissions
  xpath(%w[SER])
end

#target_emissionsObject



90
91
92
# File 'lib/view_model/cepc_s_71/cepc.rb', line 90

def target_emissions
  xpath(%w[TER])
end

#transaction_typeObject



94
95
96
# File 'lib/view_model/cepc_s_71/cepc.rb', line 94

def transaction_type
  xpath(%w[Transaction-Type])
end

#typical_emissionsObject



98
99
100
# File 'lib/view_model/cepc_s_71/cepc.rb', line 98

def typical_emissions
  xpath(%w[TYR])
end