Forum: Ruby Re: toplevel namespace justification

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Daniel.Berger (Guest)
on 2005-11-15 22:23
(Received via mailing list)
> -----Original Message-----
> From: Trans [mailto:transfire@gmail.com]
> Sent: Tuesday, November 15, 2005 1:07 PM
> To: ruby-talk ML
> Subject: toplevel namespace justification
>
>
> When is using the toplevel constant namespace justified?

Whenever you're not redefining methods for one of the core classes.

Otherwise, always use a namespace for your classes.

Regards,

Dan
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 ara.t.howard (Guest)
on 2005-11-15 22:35
(Received via mailing list)
On Wed, 16 Nov 2005, Berger, Daniel wrote:

>
> Otherwise, always use a namespace for your classes.

indeed.

i also do

   module M
     class C
     end
   end

   module N
     C = M::C
   end

when required.

-a
This topic is locked and can not be replied to.