From: Avi Bryant Date: 2001-04-03T13:53:58+09:00 Subject: [ruby-talk:13454] Re: Ruby code for attr, attr_accessor, attr_reader, attr_writer ? On Tue, 3 Apr 2001, Duff O'Melia wrote: > Is there Ruby code out there to accomplish what these methods on the Module > class accomplish? Something like: class Module def attr_accessor(*attrs) attrs.each do |attr| class_eval %{ def #{attr} @#{attr} end def #{attr}=(val) @#{attr} = val end } end end end