From: Lex Williams Date: 2008-10-03T01:30:23+09:00 Subject: Re: Problem extending (adding methods) to class Nit Khair wrote: > Nit Khair wrote: >> I am trying to extend a class developed by someone else (its from the >> ncurses-ruby lib). I need to add some fields and methods to it. >> > > On further thought I am wondering if being inside a module makes that > class different. Like some sort of static or factory class. Nothing > coming up on google on "module classes" or classes within modules. > > Could someone explain this or point me to a link. I read that modules > cannot be instantiated or subclasses - fine. What of classes declared in > them ? why don't you take advantage of open classes ? you can write this : class MyClass attr_accessor :myfield end and then you can access myfield using any instance of that class . The same goes with methods . If you write : class MyClass def my_new_method #some logic here end end then , all your objects will have that method . -- Posted via http://www.ruby-forum.com/.