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.2.3 lib/earth/fuel/fuel_type.rb
earth-0.2.2 lib/earth/fuel/fuel_type.rb
earth-0.2.1 lib/earth/fuel/fuel_type.rb
earth-0.2.0 lib/earth/fuel/fuel_type.rb
earth-0.1.4 lib/earth/fuel/fuel_type.rb
earth-0.1.3 lib/earth/fuel/fuel_type.rb
earth-0.1.2 lib/earth/fuel/fuel_type.rb
earth-0.1.1 lib/earth/fuel/fuel_type.rb
earth-0.1.0 lib/earth/fuel/fuel_type.rb
earth-0.0.43 lib/earth/fuel/fuel_type.rb
earth-0.0.42 lib/earth/fuel/fuel_type.rb
earth-0.0.41 lib/earth/fuel/fuel_type.rb
earth-0.0.40 lib/earth/fuel/fuel_type.rb
earth-0.0.39 lib/earth/fuel/fuel_type.rb
earth-0.0.38 lib/earth/fuel/fuel_type.rb
earth-0.0.37 lib/earth/fuel/fuel_type.rb
earth-0.0.36 lib/earth/fuel/fuel_type.rb
earth-0.0.35 lib/earth/fuel/fuel_type.rb
earth-0.0.34 lib/earth/fuel/fuel_type.rb
earth-0.0.33 lib/earth/fuel/fuel_type.rb