Sha256: e1f388a180c50c9df90f2902f88cb7cf723a9910ab852df56580654638bf846f

Contents?: true

Size: 1.61 KB

Versions: 16

Compression:

Stored size: 1.61 KB

Contents

class AutomobileTypeFuelControl < ActiveRecord::Base
  set_primary_key :name
  col :name
  col :type_name
  col :fuel_common_name
  col :control_name
  col :ch4_emission_factor, :type => :float
  col :ch4_emission_factor_units
  col :n2o_emission_factor, :type => :float
  col :n2o_emission_factor_units
  
  # verify "Type name, fuel common name, and control name should never be missing" do
  #   AutomobileTypeFuelControl.all.each do |record|
  #     %w{ type_name fuel_common_name control_name }.each do |attribute|
  #       value = record.send(:"#{attribute}")
  #       unless value.present?
  #         raise "Missing #{attribute} for AutomobileTypeFuelControl '#{record.name}'"
  #       end
  #     end
  #   end
  # end
  # 
  # verify "Emission factors should be greater than zero" do
  #   AutomobileTypeFuelControl.all.each do |record|
  #     %w{ ch4_emission_factor n2o_emission_factor }.each do |factor|
  #       value = record.send(:"#{factor}")
  #       unless value > 0
  #         raise "Invalid #{factor} for AutomobileTypeFuelControl '#{record.name}': #{valuel} (should be > 0)"
  #       end
  #     end
  #   end
  # end
  # 
  # verify "Emission factor units should be kilograms per kilometre" do
  #   AutomobileTypeFuelControl.all.each do |record|
  #     %w{ ch4_emission_factor_units n2o_emission_factor_units }.each do |attribute|
  #       units = record.send(:"#{attribute}")
  #       unless units == "kilograms_per_kilometre"
  #         raise "Invalid #{attribute} for AutomobileTypeFuelControl '#{record.name}': #{units} (should be kilograms_per_kilometre)"
  #       end
  #     end
  #   end
  # end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
earth-0.11.7 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.11.6 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.11.5 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.11.4 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.11.3 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.11.2 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.11.1 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.11.0 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.7.0 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.6.6 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.6.5 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.6.4 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.6.3 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.6.2 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.6.1 lib/earth/automobile/automobile_type_fuel_control.rb
earth-0.6.0 lib/earth/automobile/automobile_type_fuel_control.rb