Good question!
Using :: you have access to the class inside the module. Module can nest
another modules and so on. :: its a namespace resolution operator.
Call ::String.new inside some module back you to top-level namespace
(outside the module)
Here is examples
class String
def initialize
puts "im string outside module"
end
end
module ActiveRecord
module AnotherModule
end
class String
def initialize
puts "im string inside module"
end
end
class Base
def initialize
::String.new
String.new
end
end
end
Here are results from IRB:
1.9.3-p392 :021 > ActiveRecord::Base.new
im string outside module
im string inside module
=> #<ActiveRecord::Base:0xa024fb8>
1.9.3-p392 :022 > ActiveRecord::String.new
im string inside module
=> #<ActiveRecord::String:0xa023168>