2011-01-27 13 views

答えて

52

これは、トップレベルの名前空間から定数Fileを参照していることを意味します。これは次のような状況で理にかなっています:

class MyClass #1 
end 

module MyNameSpace 
    class MyClass #2 
    end 

    def foo # Creates an instance of MyClass #1 
    ::MyClass.new # If I left out the ::, it would refer to 
        # MyNameSpace::MyClass instead. 
    end 
end 
関連する問題