Sha256: cf3fb4ff6b0af26548950c9bd0af04c9c318a84902f6cf3dbac0309e5e16c24a

Contents?: true

Size: 992 Bytes

Versions: 10

Compression:

Stored size: 992 Bytes

Contents

# DEPRECATED but FuelPurchase still uses this
class FuelType < ActiveRecord::Base
  set_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.10 lib/earth/fuel/fuel_type.rb
earth-0.11.9 lib/earth/fuel/fuel_type.rb
earth-0.11.8 lib/earth/fuel/fuel_type.rb
earth-0.11.7 lib/earth/fuel/fuel_type.rb
earth-0.11.6 lib/earth/fuel/fuel_type.rb
earth-0.11.5 lib/earth/fuel/fuel_type.rb
earth-0.11.4 lib/earth/fuel/fuel_type.rb
earth-0.11.3 lib/earth/fuel/fuel_type.rb
earth-0.11.2 lib/earth/fuel/fuel_type.rb
earth-0.11.1 lib/earth/fuel/fuel_type.rb