Vehicle inheritance exercise
MyTruck and MyCar do not need their own initialize, the behaviour looks the same as the one in MyVehicle.

if self.on == false may be replaced with if !self.on or predicates

def on?
  on
end
def off?
  !on
end


see http://ruby-for-beginners.rubymonstas.org/objects/predicates.html .

Using self.class.mileage(self.gallons, distance.to_i) allows to overwrite class method mileage.

self.speed == 0 may be replaced with self.speed.zero? because
0, 1 and the likes are Integer objects and respond to zero?, although this is opinionated, i.e. not every object respond to zero?.