On 09/10/06, John Ky <newhoggy / gmail.com> wrote:
> Hi Austin,
>
> This code doesn't work either:
>
> > module A; module B; module C
> > end; end; end
> >
> > module A::B::C::D
> >   def D.f
> >   end
> > end
>
> testns.rb:5: uninitialized constant A::B::C::D::D (NameError)

It's the presence of D in the method name that's the problem; any of
these will work:

module A::B::C::D
  def self.f
    puts 'foo'
  end
end

module A::B::C::D
  def f
    puts 'foo'
  end
  module_function :f
end

module A::B::C::D
  def f
    puts 'foo'
  end
  extend self
end

Paul.