From: Jim Freeze Date: 2003-01-06T11:20:06+09:00 Subject: Re: attr_cast, one a small step for interface techniques On Monday, 6 January 2003 at 10:30:54 +0900, Tom Sawyer wrote: > another addition to tomslib/rubylib: > > class Module > def attr_cast(names_cast) > names_cast.each { |name, cast| > class_eval <<-EOS > def #{name} > @#{name} > end > def #{name}=(arg) > @#{name} = arg.#{cast} > end > EOS > } > end > end Wow, that's cool. But, should it be named somthing like: attr_accessor_cast or attr_accessor_with_cast -- Jim Freeze ---------- The meta-Turing test counts a thing as intelligent if it seeks to devise and apply Turing tests to objects of its own creation. -- Lew Mammel, Jr.