On Tue, 20 Mar 2001, Ville Mattila wrote:
> Hello
> I trying to do simple thing like this
> class Foo  < Module
>   def add_attr(name=nil,value=nil)
>     attr_accessor eval(":" + name)
>     eval("@" + name + "=" + value)
>   end
> end

instead of the eval line, try:

send(name+"=", value)

this should call the accessor you just created.

or else you can do with eval:

eval("@" + name + "=value")

so that the value is picked directly from the parameters instead of being
reevaluated for no particular reason.

matju