R
Rick Tan
Is there a way in Ruby to use the content of a variable as the name of a
variable. For example
var1 = 'myVar'
i want to assign a value to 'myVar' by referencing var1. The name of
the variable can vary depending on the content of var1. Other
application include using a variable to hold the name of a class method
which i need to call in my code.
Thanks in advance
variable. For example
var1 = 'myVar'
i want to assign a value to 'myVar' by referencing var1. The name of
the variable can vary depending on the content of var1. Other
application include using a variable to hold the name of a class method
which i need to call in my code.
Thanks in advance