L
lschweyer
I am have a moderate knowledge of Ruby and OO programming.
In my current Ruby program I have an include file that just contains
my global variables. Now, I read some where, that I should avoid
using
globals as they can be easily trampled on.
I use the globals to hold information I've read from an XML file at
startup
time that contains various options for my program and are easily
referenced
by my procedures.
If I'm to avoid globals, then where would be a good place to keep
these
options? Should I create an Option class and pass it around?
Thanks for any tips.
In my current Ruby program I have an include file that just contains
my global variables. Now, I read some where, that I should avoid
using
globals as they can be easily trampled on.
I use the globals to hold information I've read from an XML file at
startup
time that contains various options for my program and are easily
referenced
by my procedures.
If I'm to avoid globals, then where would be a good place to keep
these
options? Should I create an Option class and pass it around?
Thanks for any tips.