build flatten without using Array#flatten example: [[1,2,[3]],4] to [1,2,3,4]
Run following command to test the functioning of the extension method on Array rspec ./flatten_spec.rb --format documentation
As commented as well in the code, i used the most basic methods i can think of to avoid #each, #flatten and others and make it as plain ruby as possible. Basically what we do is making an recursive loop, to make an infinitly deeply nested array even flattable, it would be the developers responsibility to use this carefully as for sure it's not the optimal way to work with to large array's as this would require memory usage and speed usage testing.
We extended the Array class as the method can practically be used on any array and has been tested to work with flat and non flat array's. Besides this there would be a need to require 'array_extensions'
if not auto loader is used.
After requiring the right file we can now use the awsome interview_flattener
method by calling it on any array we've created. example: [1,2,[3,4]].interview_flattener