From: Rick DeNatale Date: 2010-01-14T00:29:39+09:00 Subject: Re: Is 'rescue' expensive ? One of the things that seems to be mostly missing from this discussion (which after all started out with dealing with a difference between Ruby 1.8 and 1.9, is that since Ruby class definitions are executable, you can move the overhead to class definition time with code like class Foo def some_version_independent method #... end if RUBY_VERSION =~ /^1\.9/ def some_version_dependent_method #implementation which works in 1.9 end else def some_version_dependent_method #implementation which works in 1.8 end end end -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale