What does double :: mean in ruby?

module Rails

 class Server < ::Rack::Server

What does the double :: before Rack::Server mean?

:: is a namespace separator. When it comes first, it means “start looking in the global namespace”. Basically, it tells Ruby to only look for Rack not Rails::Rack when it’s nested inside the Rails module.

1 Like