I have 2 ruby files, Demo.rb and Config.rb.
In my Demo.rb file I'm requiring my Config.rb file:
require './Config'
puts Config::test
puts Config::test2
Config.rb is as follows:
module Config
# trying to add varibles/config details
config1 = 'test'
config2 = 'test2'
end
Now what I'm trying to do is have some variables in my Config module, and then be able to read those values from Demo.rb, but I keep getting an error. I've tried Config.test as well, but it keeps complaining about:
undefined method `user' for Config:Module
I was reading here: http://learnrubythehardway.org/book/ex40.html about it, but I seem to be doing what it's asking. Not sure where I'm going wrong.