[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

class_eval do {nothing}?

Giles Bowkett

8/15/2007 10:18:00 PM

I'm attempting to redefine existing methods with class_eval() and
nothing's happening. Assuming my namespaces are right, is there
anything else to watch out for? The methods I'm targeting are private
instance methods. Does being private somehow shield them from
class_eval? I would have thought the answer was definitely no but the
redefinition is definitely floundering.

--
Giles Bowkett

Blog: http://gilesbowkett.bl...
Portfolio: http://www.gilesg...

2 Answers

David A. Black

8/15/2007 10:37:00 PM

0

Giles Bowkett

8/15/2007 11:49:00 PM

0

> > I'm attempting to redefine existing methods with class_eval() and
> > nothing's happening. Assuming my namespaces are right, is there

> Can you show an example? I've tried this:

It turned out that it was a namespace thing. I tested it by changing
the class_eval to do a remove_method on the methods, got method not
found errors, and fixed the namespacing.

--
Giles Bowkett

Blog: http://gilesbowkett.bl...
Portfolio: http://www.gilesg...