From: Marcin Wolski Date: 2010-05-25T15:31:01+09:00 Subject: Re: Redefine a Class? Mark T wrote: > Hi Marcin, > The String class is used as an example Class. > Could be anything. > Issue is in trying to (delete)/redefine a class. > >> What are your trying to do? You want to extend String class? I ask, > > MarkT You can open existing class, and redefine methods. For example #defined Soda class class Soda def initialize @brand = "SweetenedSugar" end def retrieve_brand return @brand end end puts Soda.new.retrieve_brand #this will return "SweetenedSugar" #now, for example, you can open this class and redefine retrieve_brand method class Soda def retrieve_brand return @brand.upcase end end puts Soda.new.retrieve_brand #this will return "SWEETENEDSUGAR" Hope this is what you want? -- Posted via http://www.ruby-forum.com/.