Class: Fuel
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Fuel
- Defined in:
- lib/earth/fuel/fuel.rb
Instance Method Summary collapse
- #biogenic_fraction ⇒ Object
- #carbon_content ⇒ Object
- #carbon_content_units ⇒ Object
- #co2_biogenic_emission_factor ⇒ Object
- #co2_biogenic_emission_factor_units ⇒ Object
- #co2_emission_factor ⇒ Object
- #co2_emission_factor_units ⇒ Object
- #energy_content ⇒ Object
- #energy_content_units ⇒ Object
- #latest_year ⇒ Object
- #oxidation_factor ⇒ Object
Instance Method Details
#biogenic_fraction ⇒ Object
54 55 56 57 58 59 60 |
# File 'lib/earth/fuel/fuel.rb', line 54 def biogenic_fraction if biogenic_fraction = super biogenic_fraction elsif fuel_years.present? latest_year.biogenic_fraction end end |
#carbon_content ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/earth/fuel/fuel.rb', line 30 def carbon_content if content = super content elsif fuel_years.present? latest_year.carbon_content end end |
#carbon_content_units ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/earth/fuel/fuel.rb', line 38 def carbon_content_units if units = super units elsif fuel_years.present? latest_year.carbon_content_units end end |
#co2_biogenic_emission_factor ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/earth/fuel/fuel.rb', line 78 def co2_biogenic_emission_factor if ef = super ef elsif fuel_years.present? latest_year.co2_biogenic_emission_factor end end |
#co2_biogenic_emission_factor_units ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/earth/fuel/fuel.rb', line 86 def co2_biogenic_emission_factor_units if units = super units elsif fuel_years.present? latest_year.co2_biogenic_emission_factor_units end end |
#co2_emission_factor ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/earth/fuel/fuel.rb', line 62 def co2_emission_factor if ef = super ef elsif fuel_years.present? latest_year.co2_emission_factor end end |
#co2_emission_factor_units ⇒ Object
70 71 72 73 74 75 76 |
# File 'lib/earth/fuel/fuel.rb', line 70 def co2_emission_factor_units if units = super units elsif fuel_years.present? latest_year.co2_emission_factor_units end end |
#energy_content ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/earth/fuel/fuel.rb', line 14 def energy_content if content = super content elsif fuel_years.present? latest_year.energy_content end end |
#energy_content_units ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/earth/fuel/fuel.rb', line 22 def energy_content_units if units = super units elsif fuel_years.present? latest_year.energy_content_units end end |
#latest_year ⇒ Object
10 11 12 |
# File 'lib/earth/fuel/fuel.rb', line 10 def latest_year fuel_years.find_by_year(fuel_years.maximum('year')) end |
#oxidation_factor ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/earth/fuel/fuel.rb', line 46 def oxidation_factor if oxidation_factor = super oxidation_factor elsif fuel_years.present? latest_year.oxidation_factor end end |