Is it possible to make a class unavailable?

B

Barry

--Apple-Mail-7-935577055
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed



Is it possible to make a class unavailable via the C interface?

The opposite of rb_define_class_under?

I'd like to rb_undefine_class_under.

Since my class has become unavailable during runtime...

Thanks


If they want peace, nations should avoid the pin-pricks that precede
cannon shot
- Napoleon Bonaparte


--Apple-Mail-7-935577055--
 
G

Gyoung-Yoon Noh

Hi,

If you find something like 'undef' on class, you'd better consider using
Object's non-public class method 'remove_const'.

$ irb
irb(main):001:0> class K; end
=3D> nil
irb(main):002:0> Object.send:)remove_const, :K)
=3D> K
irb(main):003:0> K
NameError: uninitialized constant K
from (irb):3

Regards,

=20
=20
Is it possible to make a class unavailable via the C interface?
=20
The opposite of rb_define_class_under?
=20
I'd like to rb_undefine_class_under.
=20
Since my class has become unavailable during runtime...
=20
Thanks
=20
=20
If they want peace, nations should avoid the pin-pricks that precede
cannon shot
- Napoleon Bonaparte
=20
=20
=20


--=20
http://nohmad.sub-port.net
 

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,776
Messages
2,569,603
Members
45,197
Latest member
ScottChare

Latest Threads

Top