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.5.0 lib/earth/fuel/fuel_type.rb
earth-0.4.12 lib/earth/fuel/fuel_type.rb
earth-0.4.11 lib/earth/fuel/fuel_type.rb
earth-0.4.10 lib/earth/fuel/fuel_type.rb
earth-0.4.9 lib/earth/fuel/fuel_type.rb
earth-0.4.8 lib/earth/fuel/fuel_type.rb
earth-0.4.7 lib/earth/fuel/fuel_type.rb
earth-0.4.6 lib/earth/fuel/fuel_type.rb
earth-0.4.5 lib/earth/fuel/fuel_type.rb
earth-0.4.4 lib/earth/fuel/fuel_type.rb
earth-0.4.3 lib/earth/fuel/fuel_type.rb
earth-0.4.2 lib/earth/fuel/fuel_type.rb
earth-0.4.1 lib/earth/fuel/fuel_type.rb
earth-0.4.0 lib/earth/fuel/fuel_type.rb
earth-0.3.15 lib/earth/fuel/fuel_type.rb
earth-0.3.14 lib/earth/fuel/fuel_type.rb
earth-0.3.13 lib/earth/fuel/fuel_type.rb
earth-0.3.11 lib/earth/fuel/fuel_type.rb
earth-0.3.10 lib/earth/fuel/fuel_type.rb
earth-0.3.9 lib/earth/fuel/fuel_type.rb