From: "Mauricio Fernández" Date: 2003-08-18T17:59:26+09:00 Subject: Re: uninitialized constant Myclass (NameError) On Mon, Aug 18, 2003 at 04:17:08PM +0900, Dalibor Sramek wrote: > Hi. > > The following code worked in 1.6.8: > > require 'Mymodule' > > include Mymodule This includes Mymodule in Object (and hence in every Ruby object), are you sure you want to do that? > class Myclass > def quack2(q) > puts q > end > end > > (Myclass was defined in Mymodule.rb within the module) > > Now I get mc.rb:5: uninitialized constant Myclass (NameError) > > If I change the line to: class Mymodule::Myclass > it works again. > > I believe that using module::class notation is an option and the original way > should still work. Am I right? I think what you really wanted was class Mymodule class Myclass ... end end but nonetheless it's good to know that this has changed. -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com 'Ooohh.. "FreeBSD is faster over loopback, when compared to Linux over the wire". Film at 11.' -- Linus Torvalds