Sha256: a6c34ac3eb911da01b734d171a584f949316d400c056a200f0dbc5d7a17832c8

Contents?: true

Size: 833 Bytes

Versions: 6

Compression:

Stored size: 833 Bytes

Contents

module BrighterPlanet
  module Flight
    module CarbonModel
      class FuelUseEquation < Struct.new(:m3, :m2, :m1, :endpoint_fuel)
        def empty?
          values.all?(&:nil?) or values.all?(&:zero?)
        end

        def values
          [m3, m2, m1, endpoint_fuel]
        end

        def to_xml(options = {})
          options[:indent] ||= 2
          xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent])
          xml.instruct! unless options[: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
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
flight-0.1.11 lib/flight/carbon_model/fuel_use_equation.rb
flight-0.1.10 lib/flight/carbon_model/fuel_use_equation.rb
flight-0.1.9 lib/flight/carbon_model/fuel_use_equation.rb
flight-0.1.8 lib/flight/carbon_model/fuel_use_equation.rb
flight-0.1.7 lib/flight/carbon_model/fuel_use_equation.rb
flight-0.1.6 lib/flight/carbon_model/fuel_use_equation.rb