Class: BrighterPlanet::Flight::CarbonModel::FuelUseEquation
- Inherits:
-
Struct
- Object
- Struct
- BrighterPlanet::Flight::CarbonModel::FuelUseEquation
- Defined in:
- lib/flight/carbon_model/fuel_use_equation.rb
Instance Attribute Summary collapse
-
#endpoint_fuel ⇒ Object
Returns the value of attribute endpoint_fuel.
-
#m1 ⇒ Object
Returns the value of attribute m1.
-
#m2 ⇒ Object
Returns the value of attribute m2.
-
#m3 ⇒ Object
Returns the value of attribute m3.
Instance Method Summary collapse
Instance Attribute Details
#endpoint_fuel ⇒ Object
Returns the value of attribute endpoint_fuel
4 5 6 |
# File 'lib/flight/carbon_model/fuel_use_equation.rb', line 4 def endpoint_fuel @endpoint_fuel end |
#m1 ⇒ Object
Returns the value of attribute m1
4 5 6 |
# File 'lib/flight/carbon_model/fuel_use_equation.rb', line 4 def m1 @m1 end |
#m2 ⇒ Object
Returns the value of attribute m2
4 5 6 |
# File 'lib/flight/carbon_model/fuel_use_equation.rb', line 4 def m2 @m2 end |
#m3 ⇒ Object
Returns the value of attribute m3
4 5 6 |
# File 'lib/flight/carbon_model/fuel_use_equation.rb', line 4 def m3 @m3 end |
Instance Method Details
#empty? ⇒ Boolean
5 6 7 |
# File 'lib/flight/carbon_model/fuel_use_equation.rb', line 5 def empty? values.all?(&:nil?) or values.all?(&:zero?) end |
#to_xml(options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flight/carbon_model/fuel_use_equation.rb', line 13 def to_xml( = {}) [:indent] ||= 2 xml = [:builder] ||= Builder::XmlMarkup.new(:indent => [:indent]) xml.instruct! unless [:skip_instruct] xml.fuel_use_equation do |estimate_block| estimate_block.endpoint_fuel endpoint_fuel, :type => 'float' estimate_block.m1 m1, :type => 'float' estimate_block.m2 m2, :type => 'float' estimate_block.m3 m3, :type => 'float' end end |
#values ⇒ Object
9 10 11 |
# File 'lib/flight/carbon_model/fuel_use_equation.rb', line 9 def values [m3, m2, m1, endpoint_fuel] end |