From: dblack@... Date: 2007-02-18T08:43:13+09:00 Subject: Re: Passing a block into a class_eval Hi -- On Sat, 17 Feb 2007, Clifford Heath wrote: > Of course, that should be: > > class Foo > MAX = 14 > typed_attr(Integer, nil, :foo) {|v| v <= MAX } > array_attr(Range, :bar) {|v| v.end+(v.exclude_end? ? 0 : 1) < MAX } > end > > Can't use a block without parenthesizing the params... You can, actually: irb(main):013:0> def x(*args); p args; yield; end => nil irb(main):014:0> x 1,2 do puts "hi" end [1, 2] hi :-) 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)