Clifford Heath wrote:
> Robert Klemme wrote:
>> You can use define_method:
>
> Doh! I went searching for that, since it wasn't in my
> (ruby 1.6) HTML manual and I expected it to have been
> added in 1.8 :-)... But I tried
>
> p Object.methods
> p Class.methods
> p Module.methods
> p Kernel.methods
>
> without success, so I stopped looking :-(
>
> Thanks for the help. I have the 1.8 book, both paper
> and PDF, but the HTML is so convenient :-).
>
> Clifford Heath.

An additional remark: you can improve performance if you extract the test
for the block's presence from the method and use your approach of code
generation for the getter and for the setter (for the case where there is
no block).

Kind regards

    robert