There is an additional difference between those declarations when inheritance is involved:
Let's assume Driver
inherits from a Person
class.
class Bus::Driver < Person
end
module Bus
class Driver < Person
end
end
When Ruby tries to resolve the Person
constant, in the first declaration it only looks for ::Person
. The second one looks for both Bus::Person
and ::Person
.
Depending on your circumstances this could make one declaration preferrable to the other.