Subject: Re: Idiom -- is there a better way?
From: "Kevin Howe" <khowe perfnet.ca>
Date: Thu, 21 Oct 2004 01:59:18 +0900
References: 117173
> class Foo
> def bar(fn)
> eval "self.#{fn}"
> end
> end
>
> ...nicer way of doing the bar(fn) stuff. Any ideas?
>
Replace eval "self.#{fn}" with method(fn).call