Ruby does not work very well, especially in memory usage. Like others, you must put your logical numbers in numbers. You will lose a lot of memory due to ruby “objectivity”. If this is a bad scenario for you, you can store in long strings and store the strings in an array, losing less memory.
http://calleerlandsson.com/2014/02/06/rubys-bitwise-operators/
You can also implement your own stone in C ++, which, of course, can use bits and doubles, losing memory. And the doubling array means 64 gates in each position, which is more than enough for your application.
Extremely large objects are always a problem and will require a lot from you to simplify work with a large collection of objects. Of course, you need to at least implement some method in order to hold some position in the array of objects that store more than one Boolean, and the other to flip them.
source share