From: "David A. Black" Date: 2008-10-03T03:40:17+09:00 Subject: Re: Problem extending (adding methods) to class --1926193751-611735172-1222972895=:31035 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-611735172-1222972895=:31035" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-611735172-1222972895=:31035 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Fri, 3 Oct 2008, Nit Khair wrote: > Jakub Pavl=C3=ADk jn. wrote: >> module ModuleM >> class ClassC >> # add new methods here >> end >> end >> > Thanks, this worked fine. > >> >> Similarly if you want to subclass ClassC, you can do it inside ModuleM >> >> module ModuleM >> class ClassD < ClassC >> # blah blah >> end >> end >> > > Not tried this. > >> or outside: >> >> class ClassD < ModuleM::ClassC >> # blah blah >> end >> > > THIS did not work. I got NoMethodErrors trying this out. I spent many > hours checking and trying to see if some other error was happening. > > I needed: > class AForm < Ncurses::FORM I don't think it was exactly this, because there is no Ncurses::FORM. Try the code in my previous post and see if it works for you. If not, please post some actual code that triggers the error you're talking about. I can't duplicate it. David --=20 Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL Advancing with Rails January 19-22 Fort Lauderdale, FL * * Co-taught with Patrick Ewing! See http://www.rubypal.com for details and updates! --1926193751-611735172-1222972895=:31035-- --1926193751-611735172-1222972895=:31035--