Hi,
I’m very new to Ruby (2 days), I’m mostly used to Python/PHP/C++.
What would be ideal would be a multidimensional array however from what
I have read Ruby does not support multidimensional arrays.
I want to be able to store data within multiple arrays and have the
values in all of the arrays linked together.
Example;
Array1
[vegetable]
[fruit]
Array2
[carrot]
[banana]
Array3
[tomato]
[apple]
I want to be able to some how output;
Vegetables;
carrot, tomato
Fruit;
banana, apple
With a multidimensional array this would be trivial;
[vegetable][carrot]
[vegetable][tomato]
[fruit][banana]
[fruit][apple]
Any help much appreciated,
Thank you.