What does :: mean at the beginning?

  • Thread starter Iñaki Baz Castillo
  • Start date
I

Iñaki Baz Castillo

Hi, looking at a Ruby code I've found this:

repo =3D ::Logging::Repository.instance

What does the first :: mean?

Thanks.

=2D-=20
I=C3=B1aki Baz Castillo
 
J

Jason Roelofs

It's an "ensure you're pulling from the top level". Works exactly the
same as in C++

Jason
 
I

Iñaki Baz Castillo

El Jueves, 21 de Agosto de 2008, Jason Roelofs escribi=F3:
It's an "ensure you're pulling from the top level". Works exactly the
same as in C++

Let me be sure:


module A
CONS =3D "AAA"
module B
CONS =3D "BBB"
end
end

module A
module B
puts ::A::CONS
end
end

=3D> AAA


Is it?

Thanks a lot.


=2D-=20
I=F1aki Baz Castillo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top