[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Is GC a class or module?

Li Chen

10/21/2006 1:00:00 PM

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



--
Posted via http://www.ruby-....

1 Answer

Gregory Seidman

10/21/2006 1:03:00 PM

0

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