Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Has a Module been defined?

Reply
Thread Tools

Has a Module been defined?

 
 
Hadmut Danisch
Guest
Posts: n/a
 
      12-14-2003
Hi,

how can I check whether a Module/Class with a given
name has already been defined?

regards
Hadmut

 
Reply With Quote
 
 
 
 
Hal Fulton
Guest
Posts: n/a
 
      12-14-2003
Hadmut Danisch wrote:
> Hi,
>
> how can I check whether a Module/Class with a given
> name has already been defined?


Here is my first thought. There might be a problem with it,
but it works on my simple tests.

if defined?(Foo) && Foo.is_a?(Module)

Hal



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Version 0.3.8 of the Python config module has been released. Vinay Sajip Python 0 03-03-2010 09:59 PM
the tutor list has been strangely silent for a few days. Anyone knowwhat has happened? bill.wu Python 0 01-17-2008 03:38 PM
Version 0.3.7 of the config module has been released Vinay Sajip Python 0 10-05-2007 11:15 AM
The printing has been stopped and this job has been add to the queu? dejola Computer Support 6 12-30-2005 03:26 AM
I need help I has been over 6 months since I've been able to do the system check for updates Marc Computer Support 8 07-25-2005 07:04 PM



Advertisments