Is GC a class or module?

L

Li Chen

Hi guys,

On page 8 of 2nd Pickaxe or when I type ri GC under a window prompt
command I get the message 1. It looks like GC is a class. But on page
426 and page 491 it says GC is a built-in module. Since in Ruby a module
and a class is different. So which one is correct? Do I miss something
in message 1?

Thanks,

Li


#############message 1

C:\>ri GC
-------------------------------------------------------------- Class: GC
The +GC+ module provides an interface to Ruby's mark and sweep
garbage collection mechanism. Some of the underlying methods are
also available via the +ObjectSpace+ module.
 
G

Gregory Seidman

On Sat, Oct 21, 2006 at 09:59:45PM +0900, Li Chen wrote:
} Hi guys,
}
} On page 8 of 2nd Pickaxe or when I type ri GC under a window prompt
} command I get the message 1. It looks like GC is a class. But on page
} 426 and page 491 it says GC is a built-in module. Since in Ruby a module
} and a class is different. So which one is correct? Do I miss something
} in message 1?

% irb
irb(main):001:0> GC.class
=> Module
irb(main):002:0>

} Thanks,
} Li
--Greg
 

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

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top