From: "Iñaki Baz Castillo" Date: 2008-04-30T08:26:39+09:00 Subject: Re: Where and how is defined "attr_accessor"? El Miércoles, 30 de Abril de 2008, David A. Black escribió: > The last two definitions of FieldAccessor look wrong; you haven't > defined the field_accessor method. But assuming that you correct that, > then yes, extending your class is the best way. Yes, sorry, what I did is: module FieldAccessor def self.field_accessor(name) module_eval %{ def #{name}() .... end } # It also works with "class_eval". end end class From extend FieldAccessor field_accessor :user, :domain end > To answer the question in your subject line: attr_accessor is an > instance method of Module. That's why all modules and classes can call > it. You could add field_accessor to Module, but extend is cleaner. Nice to know, so I was in the good way ;) Thanks a lot for your help. -- Iñaki Baz Castillo