module M
  class Z
    class << self
      X = "foo"
  def bar; 12 ; end
    end
  end
end

M::Z.bar # => 12
M::Z::X # uninitialized constant M::Z::X (NameError)

When we are able to access the method `bar` but why not the constant `X`
?

-- 
Posted via http://www.ruby-forum.com/.