From: Magnus Holm Date: 2010-06-11T04:41:23+09:00 Subject: [ruby-core:30721] Class vs module constant lookup A = 1 class Foo end Foo.const_get(:A) # => returns A Foo::A # => same as above, but also shows a warning: # "toplevel constant A referenced by Foo::A" That makes perfectly sense to me. However, if Foo is a module: A = 1 module Foo end Foo.const_get(:A) # => returns A Foo::A # => raises NameError: uninitialized constant Foo::A The behaviour of Foo::A makes sense (since Foo.ancestors doesn't include Object), but why should Foo.const_get(:A) work? // Magnus Holm