D
don
I want to access a hash via a gets command. A simplified
example, for a hash named, "test":
print 'hash name: '
hash_var = gets.chomp # enter 'test' here
puts hash_var # <-- nil
puts test # <-- the contents of the hash
One problem I see is hash_var is class String, while test is
class Hash. I cannot figure out how to make hash_var class
Hash. I'm not even sure if I am on the right track. I
would appreciate any help.
Thanks in advance,
Don
example, for a hash named, "test":
print 'hash name: '
hash_var = gets.chomp # enter 'test' here
puts hash_var # <-- nil
puts test # <-- the contents of the hash
One problem I see is hash_var is class String, while test is
class Hash. I cannot figure out how to make hash_var class
Hash. I'm not even sure if I am on the right track. I
would appreciate any help.
Thanks in advance,
Don