From: "T. Onoma" Date: 2003-12-07T01:03:10+09:00 Subject: Re: define_method with instance assignment to proc On Saturday 06 December 2003 04:55 pm, ts wrote: > svg% cat b.rb > #!/usr/bin/ruby > class Module > def cast_writer(name, cast) > if cast.kind_of?(Proc) or cast.kind_of?(Method) > define_method(name) do |x| > instance_variable_set("@" + name.to_s, cast.call(x)) > end > end > end > end > Beautiful, Guy! Thank You! T.