Class: Presenter::Export::Domestic
- Defined in:
- lib/presenter/export/domestic.rb
Instance Method Summary collapse
Methods inherited from Base
#address, #assessor, #enum_value, #heat_demand, #initialize, #metadata
Constructor Details
This class inherits a constructor from Presenter::Export::Base
Instance Method Details
#build ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/presenter/export/domestic.rb', line 3 def build view = {} view[:addendum] = @view_model.addendum view[:address] = address view[:assessment_id] = @view_model.assessment_id view[:assessor] = assessor view[:built_form] = enum_value(:built_form_string, @view_model.built_form) view[:co2_emissions_current_per_floor_area] = @view_model.co2_emissions_current_per_floor_area.to_i view[:construction_age_band] = enum_value( :construction_age_band_lookup, @view_model.main_dwelling_construction_age_band_or_year, @wrapper.schema_type, @view_model.report_type, ) view[:current_carbon_emission] = @view_model.current_carbon_emission.to_f view[:current_energy_efficiency_band] = Helper::EnergyBandCalculator.domestic(@view_model.) view[:current_energy_efficiency_rating] = @view_model. view[:date_of_assessment] = @view_model.date_of_assessment view[:date_of_expiry] = @view_model.date_of_expiry view[:date_of_registration] = @view_model.date_of_registration view[:dwelling_type] = @view_model.dwelling_type view[:energy_consumption_potential] = @view_model.energy_consumption_potential.to_i view[:environmental_impact_current] = @view_model.environmental_impact_current.to_i view[:environmental_impact_potential] = @view_model.environmental_impact_potential.to_i unless @view_model.extensions_count.nil? view[:extensions_count] = @view_model.extensions_count.to_i end view[:fixed_lighting_outlets_count] = @view_model.fixed_lighting_outlets_count.to_i view[:glazed_area] = @view_model.glazed_area.to_i unless @view_model .glazed_area.nil? unless @view_model.habitable_room_count.nil? view[:habitable_room_count] = @view_model.habitable_room_count.to_i end view[:heat_demand] = heat_demand unless @view_model.heat_loss_corridor.nil? view[:heat_loss_corridor] = @view_model.heat_loss_corridor.to_i end unless @view_model.heated_room_count.nil? view[:heated_room_count] = @view_model.heated_room_count.to_i end view[:heating_cost_current] = @view_model.heating_cost_current.to_f view[:heating_cost_potential] = @view_model.heating_cost_potential.to_f view[:hot_water_cost_current] = @view_model.hot_water_cost_current.to_f view[:hot_water_cost_potential] = @view_model.hot_water_cost_potential.to_f view[:hot_water_description] = @view_model.hot_water_description view[:hot_water_energy_efficiency_rating] = @view_model..to_i view[:hot_water_environmental_efficiency_rating] = @view_model..to_i view[:level] = @view_model.level.to_i view[:lighting_cost_current] = @view_model.lighting_cost_current.to_f view[:lighting_cost_potential] = @view_model.lighting_cost_potential.to_f view[:lighting_description] = @view_model.lighting_description view[:lighting_energy_efficiency_rating] = @view_model..to_i view[:lighting_environmental_efficiency_rating] = @view_model..to_i view[:low_energy_fixed_lighting_outlets_count] = @view_model.low_energy_fixed_lighting_outlets_count.nil? ? nil : @view_model.low_energy_fixed_lighting_outlets_count.to_i view[:low_energy_lighting] = @view_model.low_energy_lighting.nil? ? nil : @view_model.low_energy_lighting.to_i view[:main_fuel_type] = @view_model.main_fuel_type view[:main_heating_controls_descriptions] = @view_model.all_main_heating_controls_descriptions view[:main_heating_descriptions] = @view_model.all_main_heating_descriptions view[:mains_gas] = @view_model.mains_gas unless @view_model.mains_gas.nil? view[:multiple_glazed_proportion] = @view_model.multiple_glazed_proportion.to_i view[:open_fireplaces_count] = @view_model.open_fireplaces_count.to_i unless @view_model.photovoltaic_roof_area_percent.nil? view[:photovoltaic_roof_area_percent] = @view_model.photovoltaic_roof_area_percent.to_i end view[:potential_carbon_emission] = @view_model.potential_carbon_emission.to_f view[:potential_energy_efficiency_band] = Helper::EnergyBandCalculator.domestic( @view_model., ) view[:potential_energy_efficiency_rating] = @view_model. view[:primary_energy_use] = @view_model.primary_energy_use.to_i view[:property_age_band] = @view_model.property_age_band view[:property_summary] = @view_model.property_summary view[:property_type] = enum_value(:property_type, @view_model.property_type) view[:recommended_improvements] = @view_model.improvements.map do |improvement| improvement[:energy_performance_band_improvement] = Helper::EnergyBandCalculator.domestic( improvement[:energy_performance_rating_improvement], ) improvement end unless @view_model..nil? view[:related_party_disclosure_number] = @view_model. end unless @view_model..nil? view[:related_party_disclosure_text] = @view_model. end view[:secondary_heating_description] = @view_model.secondary_heating_description view[:secondary_heating_energy_efficiency_rating] = @view_model..to_i view[:secondary_heating_environmental_efficiency_rating] = @view_model..to_i view[:status] = @view_model.status view[:storey_count] = @view_model.storey_count.to_i unless @view_model .storey_count.nil? view[:tenure] = enum_value(:tenure, @view_model.tenure) view[:top_storey] = @view_model.top_storey view[:total_floor_area] = @view_model.total_floor_area.to_f view[:transaction_type] = enum_value(:transaction_type, @view_model.transaction_type) view[:type_of_assessment] = @wrapper.type.to_s unless @view_model.unheated_corridor_length.nil? view[:unheated_corridor_length] = @view_model.unheated_corridor_length.to_i end view[:wind_turbine_count] = @view_model.wind_turbine_count.to_i view[:window_description] = @view_model.window_description view[:window_energy_efficiency_rating] = @view_model..to_i view[:window_environmental_efficiency_rating] = @view_model..to_i view[:metadata] = # RdSAP only: storey_count # date_registered is removed as duplicate of date_of_registration # estimated_energy_cost is removed since this is a calculated value view end |