For Programmers: Free Programming Magazines  


Home > Archive > Ruby > March 2005 > Re: remove_const









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: remove_const
Adelle Hartley

2005-03-29, 9:01 am

Simon Strandgaard wrote:
> <glenn.parker@comcast.net> wrote:
> Object.const_set is
> need to use send to invoke it.
>
> something like this:
>
> irb(main):003:0> Object.const_set(:C, 42) => 42
> irb(main):004:0> Object.send(:remove_const,:C) if
> Object.const_defined?(:C) => 42 irb(main):005:0> C
> NameError: uninitialized constant C
> from (irb):5
> irb(main):006:0>


Thankyou both. That's working perfectly!

Adelle.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com