← Back to Upcase

What does double :: mean in ruby?

(Shankar Dhanasekaran) #1
module Rails

 class Server < ::Rack::Server

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

(Jon Yurek) #2

:: 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.