"using namespace" equivalent ?

K

killy-kun

I would like to know if there is in ruby an equivalent to the c++
instruction "using namespace" (in order not to have to prefix things by
there namespace when needed).
 
J

James Edward Gray II

I would like to know if there is in ruby an equivalent to the c++
instruction "using namespace" (in order not to have to prefix
things by there namespace when needed).

Well, if we are talking about a module, you might be able to include it:
Hello!
=> nilHello!
=> nil

Hope that helps.

James Edward Gray II
 
K

killy-kun

James said:
Well, if we are talking about a module, you might be able to include it:

Hello!
=> nil
Hello!
=> nil

Hope that helps.

James Edward Gray II

Thank you very much !!
That's exactely what I was looking for.
(I was using the "require" instruction, and I thought the "include"
instruction was quite similar, that is why I didn't try it...)
 

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

No members online now.

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top