Pistos Christou wrote: > Lou Scoras wrote: >> Perhaps another thing to consider is on a more logical level. If the >> method is not something that *any string* should be able to do, you've >> probably put it into the wrong class. > > Well, if I'm interested if a string is #vogon? or not, I can't see why I > would try to segregate strings into two groups. > > The only other alternative that comes to mind is writing un-OO stuff > like: > > class SomeApplication > def is_vogon?( str ) > VOGON_REGEXP === str > end > end > > Which just feels unRubylike to me. Just 2 cents here... I think what Lou was suggesting is that normally, something like a Vogon module might be a better place for the is_vogon? method... module Vogon def is_vogon?( str ) VOGON_REGEXP === str end module_function :is_vogon? end . . . Vogon.is_vogon?( "bleem" ) -- Posted via http://www.ruby-forum.com/.