Sha256: 8646940f12945b0c5ebc07a5b23d0fb459733d6062bf18367aae2a057df43197

Contents?: true

Size: 798 Bytes

Versions: 4

Compression:

Stored size: 798 Bytes

Contents

DataCenterCompany.class_eval do
  data_miner do
    schema Earth.database_options do
      string 'name'
      float  'power_usage_effectiveness'
    end
    
    import "a list of data center companies and their power usage effectiveness",
           :url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdFlxZVZLai01WWJOOTFiaUd1blF6VkE&hl=en&gid=0&output=csv' do
      key   'name'
      store 'power_usage_effectiveness'
    end
    
    verify "Power usage effectiveness should be one or more" do
      DataCenterCompany.all.each do |company|
        unless company.power_usage_effectiveness >= 1.0
          raise "Invalid power usage effectiveness for DataCenterCompany #{company.name}: #{company.power_usage_effectiveness} (should be >= 1.0)"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
earth-0.4.8 lib/earth/computation/data_center_company/data_miner.rb
earth-0.4.7 lib/earth/computation/data_center_company/data_miner.rb
earth-0.4.6 lib/earth/computation/data_center_company/data_miner.rb
earth-0.4.5 lib/earth/computation/data_center_company/data_miner.rb