Module: BrighterPlanet::Residence::Characterization

Defined in:
lib/residence/characterization.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



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
# File 'lib/residence/characterization.rb', line 5

def self.included(base)
  base.characterize do
    has :zip_code
    has :urbanity
    has :ownership
    has :residence_class
    has :residents
    has :clothes_machine_use
    has :dishwasher_use
    has :air_conditioner_use
    has :refrigerator_count
    has :freezer_count
    has :lighting_efficiency, :measures => :percentage
    has :floorspace_estimate, :trumps => :rooms, :measures => :area
    has :floors # not used
    has :bathrooms
    has :bedrooms
    has :full_bathrooms, :hidden => true
    has :half_bathrooms, :hidden => true
    has :rooms, :trumps => [:bathrooms, :bedrooms, :full_bathrooms, :half_bathrooms]
    has :acquisition
    has :retirement
    has :construction_year # TODO show year only
    has :occupation, :measures => :percentage
    has :annual_fuel_oil_volume_estimate, :trumps => :annual_fuel_oil_cost, :measures => :volume
    has :annual_fuel_oil_cost, :trumps => :annual_fuel_oil_volume_estimate, :measures => :cost
    has :monthly_natural_gas_volume_estimate, :trumps => :monthly_natural_gas_cost, :measurement_options => { :external => :therms, :internal => :joules }
    has :monthly_natural_gas_cost, :trumps => :monthly_natural_gas_volume_estimate, :measures => :cost
    has :monthly_electricity_use_estimate, :trumps => :monthly_electricity_cost, :measures => :electrical_energy
    has :monthly_electricity_cost, :trumps => :monthly_electricity_use_estimate, :measures => :cost
    has :green_electricity, :measures => :percentage
    has :annual_propane_volume_estimate, :trumps => :annual_propane_cost, :measures => :volume
    has :annual_propane_cost, :trumps => :annual_propane_volume_estimate, :measures => :cost
    has :annual_wood_volume_estimate, :measures => :biomass
    has :annual_kerosene_volume_estimate, :trumps => :annual_kerosene_cost, :measures => :volume
    has :annual_coal_volume_estimate, :trumps => :annual_coal_cost, :measures => :mass # it says volume, but it wants mass
    # has :annual_coal_cost, :trumps => :annual_coal_volume_estimate, :measures => :cost
  end
end