# Is GC a class or module?

**URL:** <https://www.ruby-forum.com/t/is-gc-a-class-or-module/73119>\
**Category:** Ruby\
**Created:** [October 21, 2006, 2:59pm UTC](https://www.ruby-forum.com/t/is-gc-a-class-or-module/73119 "2006-10-21T14:59:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [October 21, 2006, 2:59pm UTC](https://www.ruby-forum.com/t/is-gc-a-class-or-module/73119/1 "2006-10-21T14:59:38Z")

</div>

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.

* * *

## Class methods:

```
 disable, enable, start

```

## Instance methods:

```
 garbage_collect
```

---

<div class="post-metadata">

**Author:** ![alex-osu3](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Post date:** [October 21, 2006, 3:03pm UTC](https://www.ruby-forum.com/t/is-gc-a-class-or-module/73119/2 "2006-10-21T15:03:27Z")

</div>

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
