Skip to content

Instantly share code, notes, and snippets.

@dastels
Created March 9, 2011 16:15
Show Gist options
  • Save dastels/862475 to your computer and use it in GitHub Desktop.
Save dastels/862475 to your computer and use it in GitHub Desktop.
> arys = [[[:a, 1], [:b, 2]],
[[:c, 3], [:d, 4]],
[[:e, 5], [:f, 6]]]
=> [[[:a, 1], [:b, 2]], [[:c, 3], [:d, 4]], [[:e, 5], [:f, 6]]]
> arys.inject([]) {|r, a| r.concat a}
=> [[:a, 1], [:b, 2], [:c, 3], [:d, 4], [:e, 5], [:f, 6]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment