Skip to content

Instantly share code, notes, and snippets.

@flash-gordon
Created May 17, 2012 21:10
Show Gist options
  • Save flash-gordon/2721614 to your computer and use it in GitHub Desktop.
Save flash-gordon/2721614 to your computer and use it in GitHub Desktop.
class Array
def complect(n)
each_slice((length.to_f / n).ceil).map {|a| a.inject(:+)}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment