Sha256: 37de82a7ab593d1fe98cc9058625f3cf08be6b7ca8491fedcf96bc648309e146
Contents?: true
Size: 448 Bytes
Versions: 10
Compression:
Stored size: 448 Bytes
Contents
class ResidenceAppliance < ActiveRecord::Base self.primary_key = "name" class << self 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 end col :name col :annual_energy_from_electricity, :type => :float col :annual_energy_from_electricity_units end
Version data entries
10 entries across 10 versions & 1 rubygems