# Isn't :: a method? How to define?

**URL:** <https://www.ruby-forum.com/t/isnt-a-method-how-to-define/56401>\
**Category:** Ruby\
**Created:** [March 30, 2006, 11:16pm UTC](https://www.ruby-forum.com/t/isnt-a-method-how-to-define/56401 "2006-03-30T23:16:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [March 30, 2006, 11:16pm UTC](https://www.ruby-forum.com/t/isnt-a-method-how-to-define/56401/1 "2006-03-30T23:16:11Z")

</div>

SyntaxError: compile error  
(irb):2: syntax error  
def ::(x)

Thanks.

---

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [March 30, 2006, 11:43pm UTC](https://www.ruby-forum.com/t/isnt-a-method-how-to-define/56401/2 "2006-03-30T23:43:42Z")

</div>

On Mar 30, 2006, at 1:13 PM, itsme213 wrote:

> SyntaxError: compile error  
> (irb):2: syntax error  
> def ::(x)

It isn’t a method, its syntax.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [March 31, 2006, 12:02am UTC](https://www.ruby-forum.com/t/isnt-a-method-how-to-define/56401/3 "2006-03-31T00:02:05Z")

</div>

On Mar 30, 2006, at 4:39 PM, Eric H. wrote:

> This implementation is HODEL-HASH-9600 compliant
> 
> [http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

In fact it’s very similiar to dot (.). You wouldn’t expect to be able  
to redefine that, would you?

---

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [March 31, 2006, 12:56am UTC](https://www.ruby-forum.com/t/isnt-a-method-how-to-define/56401/4 "2006-03-31T00:56:49Z")

</div>

Ah. So it’s short for const\_get? Maybe I can still use it.

“Logan C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote in message  
news:removed\_email\_address@domain.invalid…

---

<div class="post-metadata">

**Author:** ![itsme213](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/258eb7/32.png) [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Post date:** [March 31, 2006, 5:02am UTC](https://www.ruby-forum.com/t/isnt-a-method-how-to-define/56401/5 "2006-03-31T05:02:51Z")

</div>

On Mar 30, 2006, at 5:53 PM, itsme213 wrote:

> Ah. So it’s short for const\_get? Maybe I can still use it.

It’s not exactly short for const\_get either:

class A  
def self.class\_meth  
puts “hi”  
end  
A\_CONST = 7  
end

A::class\_meth  
puts A::A\_CONST

hi  
7

In fact its const\_get or perform method, dpeneding whether or not the  
constant exists
