Skip to content

Instantly share code, notes, and snippets.

View frankie-ug's full-sized avatar

Frankline Ugwu frankie-ug

View GitHub Profile
class Array
=begin
Extends enumerable to add method frank_flatten
frank_flatten goes through each element of an array, checks if element at index is an array
if it is an array calls flatten on it to pull out each element in that array and return the
flattened array.
=end
def frank_flatten
if empty?
self