lib/car.rb
# Compute "fun" in terms of peak engine power per unit mass.
# Computed here in horsepower peak per pound curb weight.
Compute "fun" in terms of peak engine power per unit mass.
Computed here in horsepower peak per pound curb weight.
Compute " fun " in terms of peak engine power per unit mass . Computed here in horsepower peak per pound curb weight .
def unit_horsepower
    hp = @specs['peak_power']
    weight = @specs['empty_weight']
    return nil if hp.nil? || weight.nil?
    hp.to_f / weight.to_i
  end
def unit_horsepower hp = @specs [ 'peak_power' ] weight = @specs [ 'empty_weight' ] return nil if hp . nil? || weight . nil? hp . to_f / weight . to_i end
Compute "fun" in terms of peak engine power per unit mass.
Compute " fun " in terms of peak engine power per unit mass .