# What does :: do in this case?

**URL:** <https://www.ruby-forum.com/t/what-does-do-in-this-case/48972>\
**Category:** Ruby\
**Created:** [November 20, 2005, 11:04pm UTC](https://www.ruby-forum.com/t/what-does-do-in-this-case/48972 "2005-11-20T23:04:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![petermichaux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/46a35a/32.png) [@petermichaux](https://www.ruby-forum.com/u/petermichaux)\
**Post date:** [November 20, 2005, 11:04pm UTC](https://www.ruby-forum.com/t/what-does-do-in-this-case/48972/1 "2005-11-20T23:04:09Z")

</div>

Hi

This is in the Rails acts\_as\_list module but I think is a general Ruby  
question. I don’t understand the syntax of the ::#{self.name}  
statement. I haven’t seen :: without something preceding it. I think I  
understand what this method enables the plugin to do: use the class  
name in which the module is mixed.

Thanks,  
Peter

module ActiveRecord  
module Acts  
module List

```
  def acts_as_list_class
    ::#{self.name}
  end

end

```

end  
end

---

<div class="post-metadata">

**Author:** ![petermichaux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/46a35a/32.png) [@petermichaux](https://www.ruby-forum.com/u/petermichaux)\
**Post date:** [November 20, 2005, 11:12pm UTC](https://www.ruby-forum.com/t/what-does-do-in-this-case/48972/2 "2005-11-20T23:12:14Z")

</div>

On 11/20/05, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> This is in the Rails acts\_as\_list module but I think is a general Ruby  
> question. I don’t understand the syntax of the ::#{self.name}  
> statement. I haven’t seen :: without something preceding it. I think I  
> understand what this method enables the plugin to do: use the class  
> name in which the module is mixed.

Unless that’s in a section of string code to be evaled, that’s  
actually a syntax error. (The #{} syntax is only valid in strings).

However, if you do:

::File

You mean specifically that you want the File constant visible at the top  
level.

-austin
