From: "Iñaki Baz Castillo" Date: 2008-04-23T22:14:55+09:00 Subject: Re: Is possible to extend "attr_accessor" "attribue=" method? > 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 -- Iñaki Baz Castillo