From: Trans Date: 2008-11-20T18:54:17+09:00 Subject: Re: Error message, hide class name On Nov 20, 4:29 am, Ryan Davis wrote: > > Anyone know how I can get rid of the ':X' after 'hey'? I've tried: > > the problem isn't inspect or anything else to do with X, it is   > method_missing. the default method_missing is raising with a message   > like: > > "undefined method `#{msg}' for #{self.inspect}:#{self.class}" ^^^^^^^^^^ Which is why I thought I should be able to override #class. And was surprised that it did not work. Nevertheless... > So you can attack the 'problem' at the source: > > > >> class Object; def method_missing(*a); raise NoMethodError, "haha!   > > stupid!"; end; end > > => nil > > >> bork > > NoMethodError: haha! stupid! > >    from (irb):3:in `method_missing' > >    from (irb):4 That's a better approach --at least in the case of NoMethodError. Thanks, Ryan. T.