P
Phy Prabab
Hello,
I need a bit of help understanding how to use a
variable as a name for a method call. Forgive me
trying to explains this, I am new at all this. In the
code listed, I am tring to set the debugging level of
the Logger class, however, the variable in question is
not being sustituted prior to interpreting the method
call.
when "--debug"
if($DEBUG_LEVELS.include?(arg))
mylog.level = Logger::arg
^^^^^^^^^^^
else
puts "Debug level can be one of: DEBUG, INFO,
WARN, or ERROR"
dis_help
end
This causes Ruby to spit out that there is no method
called arg which is correct. So how do I get arg to
be substituted to the value rather than the var name?
I tried dereferencing and using the it within a string
(okay, a dumb idea). Any way, any help will be much
appreciated!
TIA!
Phy
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping
I need a bit of help understanding how to use a
variable as a name for a method call. Forgive me
trying to explains this, I am new at all this. In the
code listed, I am tring to set the debugging level of
the Logger class, however, the variable in question is
not being sustituted prior to interpreting the method
call.
when "--debug"
if($DEBUG_LEVELS.include?(arg))
mylog.level = Logger::arg
^^^^^^^^^^^
else
puts "Debug level can be one of: DEBUG, INFO,
WARN, or ERROR"
dis_help
end
This causes Ruby to spit out that there is no method
called arg which is correct. So how do I get arg to
be substituted to the value rather than the var name?
I tried dereferencing and using the it within a string
(okay, a dumb idea). Any way, any help will be much
appreciated!
TIA!
Phy
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping