If you put ::
at the beginning, you are referencing the global namespace; if you do not, you are referring to your current namespace.
Usually, if you do not have a class / module with the same name inside your class / module, you will not need to use ::
at the beginning.
class Customer def to_s "Customer global" end end class Order class Customer def to_s "Customer within order" end end def initialize puts Customer.new puts ::Customer.new end end Order.new
will print
Customer within order Customer global
source share