From: John Date: 2002-07-14T16:01:27+09:00 Subject: Re: instance_eval "Avi Bryant" wrote in message news:6e869a6b.0207132252.7de2c70c@posting.google.com... > "John" wrote in message news:<_x2Y8.11504$Kx3.8405@newsread1.prod.itd.earthlink.net>... > > > I tried the following after searching some previous posts: > > > > def create (&block) > > str = "def hello (*args) block.call end" > > self.instance_eval (str) > > end > > > > But to be honest I don't really know what I am doing there. > > I think you're looking for this: > > def create (&block) > self.class.define_method(:hello){block.call} > end > Is this a 1.7 feature? Is it going to be in 1.8? Thanks John.