On Apr 23, 9:14 am, "I=F1aki Baz Castillo" <i... / aliax.net> wrote:
> >  Just an issue: the above code don't allow multiple attributes definitio=
n:
>
> >   attr_accessor :atr, atr2
>
> >  =3D> `attr_accessor': wrong number of arguments (2 for 1) (ArgumentErro=
r)
>
> Done :)
>
>         def self.attr_accessor(*names)
>                 names.each { |name|
>                         module_eval %{
>                                 attr_reader :#{name}
>
>                                 def #{name}=3D (value)
>                                         @#{name} =3D value
>                                         @modified =3D true
>                                 end
>                         }
>                 }
>         end

Good work :-)

T.