1. Is this allowed
Of course it is allowed. Classes are allowed to contain constants. (BTW: it would have taken you only a couple of seconds to try it out yourself.)
or can it provoke name clashes?
I have no idea what that means, but again, you can easily test it out yourself by just copy&pasting the code you posted and run it.
2. What is Police::Office::ConstructInteractor
?
Is it a class in a module like:
module Police::Office
class ConstructInteractor
end
end
Of course not. You defined Police::Office
to be a class earlier, so it obviously is a class.
Or a class in a class?
class Police::Office
class ConstructInteractor
end
end
Yes. But note that this is not a "class in a class". This is a constant in a class. In Ruby, classes don't nest like they do in Beta, gBeta, Newspeak, or Scala (not even like in Java). There is no relationship whatsoever between the class referenced by the constant Police::Office::ConstructInteractor
and the class referenced by the constant Police::Office
.