On Apr 23, 4:49 am, "I=F1aki Baz Castillo" <i... / aliax.net> wrote:
> Hi, I'd like to use an "attr_accessor" but when its attribute is
> modified it should be executed more code than just an assignament.
> I handle it in this way (not cool):
>
>         class MyClass1 < Father
>
             def self.attr_accessor(name)
               module_eval %{
>                 attr_reader :#{name}
>
>                 def  #{name}=3D (value)
>                         @#{name} =3D value
>                         @modified =3D true
>                         ...more code...
>                 end
               }
            end

>         end

T.