Sha256: 6364fe7a1c57e346887d3c2b420703d4e37e8a92220915e4aec16a9ec9e0d3bd

Contents?: true

Size: 577 Bytes

Versions: 24

Compression:

Stored size: 577 Bytes

Contents

FuelPrice.class_eval do
  # FIXME TODO phase 2
  # location
  # month/year

  data_miner do
    schema :options => Earth.database_options do
      string  'name'
      float   'price'
      string  'price_units'
    end
    
    import 'fuel prices derived from the EIA',
           :url => 'http://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdHlSdXJoOFB5aEpHenJQbTVJdS1pMVE',
           :select => lambda { |row| row['fuel_type_name'].present? } do
      key   'name', :field_name => 'fuel_type_name'
      store 'price', :units_field_name => 'price_units'
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
earth-0.0.42 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.41 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.40 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.39 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.38 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.37 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.36 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.35 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.34 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.33 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.32 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.31 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.30 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.29 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.28 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.27 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.26 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.24 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.23 lib/earth/fuel/fuel_price/data_miner.rb
earth-0.0.22 lib/earth/fuel/fuel_price/data_miner.rb