From: Dan Zwell Date: 2007-05-24T15:05:53+09:00 Subject: Re: override def method in CGI class, without altering the class!?????? highlyjhi wrote: > Just re-write it in your program where it's needed. > > class Foo > def bar > //method to override > end > end > > Very simple. > > - Jer H. > > > On May 23, 2007, at 8:25 PM, Jer A wrote: > >> >> hello all, >> >> I am a newbie to ruby. >> >> how do I override a method from a particular class (in std class lib), >> just for one program, without modifying the class. >> >> Thanks in advance for all your help. >> >> -Jer A. >> >> _________________________________________________________________ >> Fight Allergies With Live Search >> http://search.live.com/results.aspx?q=Remedies+For+Spring+Allergies&mkt=en-ca&FORM=SERNEP >> >> >> > > > Just to clarify, you can define or redefine methods of core classes: Class String def inspect "This string's value is \"#{self}\"" end end