From: Louis J Scoras Date: 2006-05-06T11:01:14+09:00 Subject: Re: Extending Core Classes - Best Practices To be safe, you might just want to subclass String instead: #!/usr/bin/env ruby class VWord < String V_VOC = %w{freddled gruntbuggly miturations} # ... V_RGX = Regexp.new( V_VOC.join('|'), ?i ) def vogon? V_RGX === self end end word = VWord.new 'freddled' p word.vogon? word = VWord.new 'foobar' p word.vogon? Sure. It's annoying to have to call the constructor everywhere but at least you don't mess up everyone who wants to use String. I agree with Robert that it's probably alright for short scripts, but then again you know what happens when scripts decide to hang around longer than you intended =) -- Lou