In Java if I want a simple data structure I would simply declare it in a class something like this
class MySimpleStructure{
int data1;
int data2;
MyOtherDataStructure m1;
}
Then I would later use it in my program,
MySimpleStructure s1 = new MySimpleStructure();
s1.data1 = 19;
s1.m1 = new MyOtherDataStructure();
How to do an equivalent implementation in Ruby.
1 Answer