Skip to content

Instantly share code, notes, and snippets.

@piousbox
Created April 3, 2018 19:52
Show Gist options
  • Save piousbox/7539a3da68fabe5b676a870196be17b7 to your computer and use it in GitHub Desktop.
Save piousbox/7539a3da68fabe5b676a870196be17b7 to your computer and use it in GitHub Desktop.
def a b
result = []
b.map do |c|
if c.class.name == 'Array'
result += a(c)
else
result.push c
end
end
return result
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment