Sha256: 3753e3e65e24960e73b61419b2112b83235094b2fe3d9eebe5c4cfda6bade3c5

Contents?: true

Size: 443 Bytes

Versions: 19

Compression:

Stored size: 443 Bytes

Contents

class ResidenceAppliance < ActiveRecord::Base
  set_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

19 entries across 19 versions & 1 rubygems

Version Path
earth-0.11.10 lib/earth/residence/residence_appliance.rb
earth-0.11.9 lib/earth/residence/residence_appliance.rb
earth-0.11.8 lib/earth/residence/residence_appliance.rb
earth-0.11.7 lib/earth/residence/residence_appliance.rb
earth-0.11.6 lib/earth/residence/residence_appliance.rb
earth-0.11.5 lib/earth/residence/residence_appliance.rb
earth-0.11.4 lib/earth/residence/residence_appliance.rb
earth-0.11.3 lib/earth/residence/residence_appliance.rb
earth-0.11.2 lib/earth/residence/residence_appliance.rb
earth-0.11.1 lib/earth/residence/residence_appliance.rb
earth-0.11.0 lib/earth/residence/residence_appliance.rb
earth-0.7.0 lib/earth/residence/residence_appliance.rb
earth-0.6.6 lib/earth/residence/residence_appliance.rb
earth-0.6.5 lib/earth/residence/residence_appliance.rb
earth-0.6.4 lib/earth/residence/residence_appliance.rb
earth-0.6.3 lib/earth/residence/residence_appliance.rb
earth-0.6.2 lib/earth/residence/residence_appliance.rb
earth-0.6.1 lib/earth/residence/residence_appliance.rb
earth-0.6.0 lib/earth/residence/residence_appliance.rb