@abakobo said:
what's behind the :: symbol in Geom ?
It is called the scope operator.
:: with nothing to the left of it means the top level scope (aka TOPLEVEL_BINDING,) which is "a particular instance of Object called 'main'".
But it's use that way is optional. Ruby always checks the current scope first, then the top level scope if it needs to.
But this is also why you should always be executing YOUR code inside a toplevel module, with some unique name that you invent. like
module Abakobo
So Geom::Point3d is referring to the Point3d class, within the Geom module scope.
@abakobo said:
and when do we use :: and/or . to call a method
It's style, but many people only use the . for ALL methods.
Some people use :: for calling module functions and class methods (which the new constructor is,) and then use . to call only instance methods. (Some of the older examples, from the days when SketchUp was owned by Google or @Last Software, use this latter convention. I guess they wanted to emphasize the calling of class methods or module functions.)
💭