Sha256: ee0577615a9db44b84fbbfb7c330f3661426a25c3f4a67fa0077c83d2d827098

Contents?: true

Size: 997 Bytes

Versions: 10

Compression:

Stored size: 997 Bytes

Contents

# DEPRECATED but FuelPurchase still uses this
class FuelType < ActiveRecord::Base
  self.primary_key = "name"
  
  has_many :prices, :class_name => 'FuelPrice', :foreign_key => 'name' # weird
  
  falls_back_on :emission_factor               => 1.0, #FIXME TODO put a real value here - also do we want to do emission factors in kg / kj?
                :emission_factor_units         => 'FIXME',
                :average_purchase_volume       => 100, #FIXME TODO put a real value here - also do we want to do volumes in kJ?
                :average_purchase_volume_units => 'FIXME'
  
  def price
    prices.average :price
  end
  
  col :name
  col :emission_factor, :type => :float
  col :emission_factor_units
  col :density, :type => :float
  col :density_units
  col :average_purchase_volume, :type => :float
  col :average_purchase_volume_units
  # col :energy_content, :type => :float
  # col :energy_content_units
  # col :carbon_content, :type => :float
  # col :carbon_content_units
end

Version data entries

10 entries across 10 versions & 1 rubygems

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