When used before a method, as Matz told us (thank you!), It's the same.
Other than that, it just "walks" into a module.
No, constants don't represent namespaces. They are essentially the same as variables but can be accessed from anywhere (and the interpreter will warn you when you change the value).
Ruby doesn't really have namespaces. It has modules instead. Classes act as modules too (Class is a subclass of Module).
I REALLY recommend you to read the chapter on modules in "The Ruby Programming Language" book written by Matz and David Flanagan. It's incredibly important part of the language so you should learn it as a whole, not receive bits and pieces here:)
Sent from my iPhone
On 12 Jul 2020, at 08:27, Die Optimisten <firstname.lastname@example.org> wrote:
What is the difference between . and :: ? (x.method, x::method work !)
Are they the same (for the interpreter), and just for the humans?
When should I use whicn one?
Do Contants define Namespaves?
Where is a good documentation of Namespaces (including
Namespace-inheritance [vs Class/Object-inheritance] ),
or can s.o. describe it in a short way?