Dynamic Monkey patching of getter / setter methods?

J

Jan Luehr

Hello folks,

I'm playing around with dynamic monkey-patching of methods. However, I
run into syntax errors of my generated code:
ruby monkey.rb
Two: unpatched
---
Patched test_two called
Two: patched
monkey.rb:12:in `catch_method': (eval):4:in `catch_method': compile
error (SyntaxError)
(eval):3: syntax error, unexpected ',', expecting '='
old_test_attribute=(*args,&block)
^
from monkey.rb:33

Do you know a way for dynamic monkey-patching of getter / setter methods?

(source at: http://pastie.org/1132204)

Thanks,
Keep smiling
yanosz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top