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.3.8 lib/earth/fuel/fuel_type.rb
earth-0.3.7 lib/earth/fuel/fuel_type.rb
earth-0.3.6 lib/earth/fuel/fuel_type.rb
earth-0.3.5 lib/earth/fuel/fuel_type.rb
earth-0.3.4 lib/earth/fuel/fuel_type.rb
earth-0.3.3 lib/earth/fuel/fuel_type.rb
earth-0.3.2 lib/earth/fuel/fuel_type.rb
earth-0.3.1 lib/earth/fuel/fuel_type.rb
earth-0.3.0 lib/earth/fuel/fuel_type.rb
earth-0.2.14 lib/earth/fuel/fuel_type.rb
earth-0.2.13 lib/earth/fuel/fuel_type.rb
earth-0.2.12 lib/earth/fuel/fuel_type.rb
earth-0.2.11 lib/earth/fuel/fuel_type.rb
earth-0.2.9 lib/earth/fuel/fuel_type.rb
earth-0.2.8 lib/earth/fuel/fuel_type.rb
earth-0.2.7 lib/earth/fuel/fuel_type.rb
earth-0.2.6 lib/earth/fuel/fuel_type.rb
earth-0.2.5 lib/earth/fuel/fuel_type.rb
earth-0.2.4 lib/earth/fuel/fuel_type.rb
earth-ruby19-0.2.3 lib/earth/fuel/fuel_type.rb