Flatten arbitrarily nested arrays in Ruby This is a recursive solution to the flatten problem, not using the standard library method. It contains a function and 3 tests. If you have Ruby installed, you can run this code with ruby main.rb from a terminal shell.