is there any way to create variables in Ruby with dynamic names?
I'm reading a file and when I find a string, generates a hash.
e.g.
file = File.new("games.log", "r")
file.lines do |l|
l.split do |p|
if p[1] == "InitGame"
Game_# = Hash.new
end
end
end
How could I change # in Game_# to numbers (Game_1, Game_2, ...)
Game_togame_.sends. Looks like an array to me.