Class: ResidenceAppliance
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- ResidenceAppliance
- Extended by:
- Earth::Model
- Defined in:
- lib/earth/residence/residence_appliance.rb
Constant Summary collapse
- TABLE_STRUCTURE =
"\nCREATE TABLE residence_appliances\n (\n name CHARACTER VARYING(255) NOT NULL PRIMARY KEY,\n annual_energy_from_electricity FLOAT,\n annual_energy_from_electricity_units CHARACTER VARYING(255)\n );\n\n"
Class Method Summary collapse
Methods included from Earth::Model
extend_mining, extended, registry
Class Method Details
.annual_energy_from_electricity_for(appliance_plural) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/earth/residence/residence_appliance.rb', line 20 def annual_energy_from_electricity_for(appliance_plural) appliance_name = appliance_plural.to_s.singularize if appliance = find_by_name(appliance_name) appliance.annual_energy_from_electricity end end |