[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Accessing variables/constants from another file

saudaziz@gmail.com

3/7/2006 7:38:00 PM

How can i access "myvariable" in the provided code from

Say constants.rb has the following code

Module

myvariable = 'foo'

end

And another file driver.rb has following code

require constants

class myclass < food

def busted
#how can i call 'myvariable' constant here?

end

end


Also, if you can tell me what exactly is the difference between require
and include, that would be great help. I don't see any clear
explanation anywhere for the above.

1 Answer

dblack

3/7/2006 8:48:00 PM

0