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

Version Path
earth-0.11.20 lib/earth/residence/residence_appliance.rb
earth-0.11.19 lib/earth/residence/residence_appliance.rb
earth-0.11.18 lib/earth/residence/residence_appliance.rb
earth-0.11.17 lib/earth/residence/residence_appliance.rb
earth-0.11.16 lib/earth/residence/residence_appliance.rb
earth-0.11.15 lib/earth/residence/residence_appliance.rb
earth-0.11.14 lib/earth/residence/residence_appliance.rb
earth-0.11.13 lib/earth/residence/residence_appliance.rb
earth-0.11.12 lib/earth/residence/residence_appliance.rb
earth-0.11.11 lib/earth/residence/residence_appliance.rb