The period .
is only meant for accessing methods.
The double colon ::
is used to indicate namespaces.
Both modules and classes can be nested in each other. This creates a namespace for the nested class. (Technically, Module is an instance of Class.) Thus, the following is correct no matter if Hints or Designer are a class or a module.
Hints::Designer.message
You can try yourself by opening irb
on the command line. Hints.Designer.message
says NoMethodError: undefined method 'Designer' for Hints:Module
.
Update (as I am not allowed to comment...):
While many things in Ruby can be overwritten ("monkey patched"), basic operators cannot. ::
is a basic language feature that is and should not be customizable (in order to prevent a big mess ;)).