From: Lyle Johnson Date: 2003-12-03T11:57:06+09:00 Subject: Re: What's the best way to create methods dealing with an object of a certain class? Leif K-Brooks wrote: > I want to add a method to be run on Strings. Currently, I'm just adding > it on to the String class. Should I be subclassing it instead? Creating > a method which takes a String as an argument? I have mixed feelings about re-opening built-in classes (like String) to add new methods to them, even though the provision for this is one of Ruby's attractions. My concern is that people get used to the built-ins and expect certain standard behaviors from them; augmenting or otherwise changing them could create confusion for other people looking at your code. I don't think there's a "right" answer to the question. If I were in your situation I'd probably write a little helper method that takes the string as an input argument. Jusy my $0.02, Lyle