Sha256: cf57ec6f6972653d305742f58627854c78e00840fce8e1bf8e32bd74989075f2

Contents?: true

Size: 671 Bytes

Versions: 74

Compression:

Stored size: 671 Bytes

Contents

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'
  
  data_miner do
    tap "Brighter Planet's fuel types data", Earth.taps_server
  end
  
  def price
    prices.average :price
  end
end

Version data entries

74 entries across 74 versions & 2 rubygems

Version Path
earth-0.0.32 lib/earth/fuel/fuel_type.rb
earth-0.0.31 lib/earth/fuel/fuel_type.rb
earth-0.0.30 lib/earth/fuel/fuel_type.rb
earth-0.0.29 lib/earth/fuel/fuel_type.rb
earth-0.0.28 lib/earth/fuel/fuel_type.rb
earth-0.0.27 lib/earth/fuel/fuel_type.rb
earth-0.0.26 lib/earth/fuel/fuel_type.rb
earth-0.0.24 lib/earth/fuel/fuel_type.rb
earth-0.0.23 lib/earth/fuel/fuel_type.rb
earth-0.0.22 lib/earth/fuel/fuel_type.rb
earth-0.0.21 lib/earth/fuel/fuel_type.rb
earth-0.0.20 lib/earth/fuel/fuel_type.rb
earth-0.0.19 lib/earth/fuel/fuel_type.rb
earth-0.0.18 lib/earth/fuel/fuel_type.rb