From: Joel VanderWerf Date: 2006-06-22T08:03:40+09:00 Subject: Re: Class Names Aaron Patterson wrote: > Hi, I was wondering how I can reffer to a class outside of my class, but > it has the same name. Hopefully the following code will make it more > clear: > > module Test > class File > def print_file > # I don't want to call Test::File.open here: > File.open('test.rb', "r") { |f| puts f.read } ::File.open('test.rb', "r") { |f| puts f.read } The :: means look up the constant in the top level scope. > end > end > end > > Test::File.new().print_file -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407