From: dblack@... Date: 2007-02-18T01:15:40+09:00 Subject: Re: Passing a block into a class_eval Hi -- On Sat, 17 Feb 2007, Clifford Heath wrote: > dblack@wobblini.net wrote: >> I guess my first take on it would be this: >> (using define_method rather than def so that the local variable block >> will still be in scope). > > Excellent! I added the missing instance_variable_set and I'm away. Whoops, I knew it looked too short :-) > My full example has type checking, and whether nil is allowed. I'll bet you mean class checking :-) But that's another (long) story.... David -- Q. What is THE Ruby book for Rails developers? A. RUBY FOR RAILS by David A. Black (http://www.manning.com/black) (See what readers are saying! http://www.rubypal.com/r4rrevs.pdf) Q. Where can I get Ruby/Rails on-site training, consulting, coaching? A. Ruby Power and Light, LLC (http://www.rubypal.com)