From: Tom Sawyer Date: 2002-08-15T13:02:56+09:00 Subject: Re: ambiguity between local variable assignment and writter method On Mon, 2002-08-12 at 10:17, dblack@candle.superlink.net wrote: > > class Module > def attr_rw(*names) > names.each do |name| > class_eval <<-EOS > def #{name}(*args) > @#{name} = args[0] if args.size > 0 > @#{name} > end > EOS > end > end > > def attr_ro(*names) > names.each do |name| > class_eval <<-EOS > def #{name} > @#{name} > end > EOS > end > end > end > by the way, thanks for this david. much nicer than mine --very elegant. when i get a chance (way too busy at the moment) i'll investigate your comments. ~transami