# What does '::' actually mean?

**URL:** <https://www.ruby-forum.com/t/what-does-actually-mean/124003>\
**Category:** Rails\
**Created:** [December 23, 2007, 10:23am UTC](https://www.ruby-forum.com/t/what-does-actually-mean/124003 "2007-12-23T10:23:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Davo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@Davo](https://www.ruby-forum.com/u/Davo)\
**Post date:** [December 23, 2007, 10:23am UTC](https://www.ruby-forum.com/t/what-does-actually-mean/124003/1 "2007-12-23T10:23:00Z")

</div>

HI everyone,

I’m just getting my head around Ruby/RoR syntax & wondered exactly  
what the colon/colon means in the example below ( and similar  
contexts ) ? ( I see that the \< is inheritance )

I’ve read it is something to do with Class Methods ?

I also assume it is Ruby ? not RoR

e.g.  
class ApplicationController \< ActionController::Base

TIA - Dave P.

---

<div class="post-metadata">

**Author:** ![Davo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@Davo](https://www.ruby-forum.com/u/Davo)\
**Post date:** [December 23, 2007, 11:43am UTC](https://www.ruby-forum.com/t/what-does-actually-mean/124003/2 "2007-12-23T11:43:34Z")

</div>

Its a ruby thing. Maybe this will help, the abridged source to the  
example you gave

module ActionController  
class Base  
#…bunch of code…  
end  
end

And then that is referenced as

ActionController::Base

Usually I imagine it as a namespace thing. The module is  
ActionController. The specific class is Base.

There is actually more to it but thats a start.

---

<div class="post-metadata">

**Author:** ![Davo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@Davo](https://www.ruby-forum.com/u/Davo)\
**Post date:** [December 23, 2007, 11:45am UTC](https://www.ruby-forum.com/t/what-does-actually-mean/124003/3 "2007-12-23T11:45:32Z")

</div>

On Sun, 23 Dec 2007 01:22:17 -0800, Davo wrote:

> I’ve read it is something to do with Class Methods ?

I’m a newbie to ruby, and this is really a ruby question, rather than a  
rails question, but, yes, it signifies class methods.

An instance method will give varying results – unique to each instance  
(object). The simplest example of an instance method (coming from Java)  
would be the getter/setter methods.

foo.set\_var = 5  
foo.print\_var #will print “5”

bar.set\_var = 10  
bar.print\_var #will print “10”

Here, the same method will give different results. For object foo, the  
result is 5, for object bar the result is 10.

Conversely, consider:

myMath.sin(x)

Do you want the above to give different results for different instances?  
I would hope not!

-Thufir

---

<div class="post-metadata">

**Author:** ![Davo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@Davo](https://www.ruby-forum.com/u/Davo)\
**Post date:** [December 24, 2007, 8:16am UTC](https://www.ruby-forum.com/t/what-does-actually-mean/124003/4 "2007-12-24T08:16:35Z")

</div>

Thanks to everyone for their help…  
Merry Xmas to all.  
Dave

---

<div class="post-metadata">

**Author:** ![Davo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@Davo](https://www.ruby-forum.com/u/Davo)\
**Post date:** [December 24, 2007, 8:10am UTC](https://www.ruby-forum.com/t/what-does-actually-mean/124003/5 "2007-12-24T08:10:44Z")

</div>

I have a screencast for this “Modules in Ruby”. Check it out.

On Dec 23, 2007 1:22 AM, Davo [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> HI everyone,
> 
> I’m just getting my head around Ruby/RoR syntax & wondered exactly  
> what the colon/colon means in the example below ( and similar  
> contexts ) ? ( I see that the \< is inheritance )

–  
[http://www.rubyplus.org/](http://www.rubyplus.org/)  
Free Ruby Screencasts
