From: Trans Date: 2008-04-24T01:25:12+09:00 Subject: Re: Is possible to extend "attr_accessor" "attribue=" method? On Apr 23, 9:14 am, "Iņaki Baz Castillo" wrote: > > Just an issue: the above code don't allow multiple attributes definition: > > > attr_accessor :atr, atr2 > > > => `attr_accessor': wrong number of arguments (2 for 1) (ArgumentError) > > Done :) > > def self.attr_accessor(*names) > names.each { |name| > module_eval %{ > attr_reader :#{name} > > def #{name}= (value) > @#{name} = value > @modified = true > end > } > } > end Good work :-) T.