# Double colon in class definition?

**URL:** <https://www.ruby-forum.com/t/double-colon-in-class-definition/108118>\
**Category:** Ruby\
**Created:** [June 29, 2007, 5:03am UTC](https://www.ruby-forum.com/t/double-colon-in-class-definition/108118 "2007-06-29T05:03:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rlorimor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/96bed5/32.png) [@rlorimor](https://www.ruby-forum.com/u/rlorimor)\
**Post date:** [June 29, 2007, 5:03am UTC](https://www.ruby-forum.com/t/double-colon-in-class-definition/108118/1 "2007-06-29T05:03:22Z")

</div>

What does the double colon mean in a class definition. e.g.  
ActiveRecord::Base ? I couldn’t locate it in the docs. I suspect  
it’s akin to a category or a namespace. The only documentation on  
double-colon that I have found indicates that “::” is used to make  
class methods easier to read since “.” will also call a class method.

---

<div class="post-metadata">

**Author:** ![rlorimor](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/96bed5/32.png) [@rlorimor](https://www.ruby-forum.com/u/rlorimor)\
**Post date:** [June 29, 2007, 6:26am UTC](https://www.ruby-forum.com/t/double-colon-in-class-definition/108118/2 "2007-06-29T06:26:28Z")

</div>

On Jun 28, 10:02 pm, Robert La Ferla [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> What does the double colon mean in a class definition. e.g.  
> ActiveRecord::Base ? I couldn’t locate it in the docs. I suspect  
> it’s akin to a category or a namespace. The only documentation on  
> double-colon that I have found indicates that “::” is used to make  
> class methods easier to read since “.” will also call a class method.

In this case, it indicates that Base is a class within the  
ActiveRecord module. More generally, it’s used to reference a constant  
(modules & classes are constants) within a module (similar to a  
namespace) or a class. As in:

irb\> Object::Fixnum.class  
=\> Class  
irb\> Object::RUBY\_VERSION.class  
=\> String
