module Vehicle
class Car < Wheeled
end
end
module Vehicle
class Bike < Wheeled
end
end
What does this pattern of creating classes try to achieve is what I am not able to understand. What will be the disadvantage of doing this by including Vehicle as a module in the other classes?
Doing it this way keeps those classes namespaced under the
Vehiclemodule:This way, you could also have a separate
Carclass outside of the module, and theVehicle::Carclass will not interfere.