Skip to content

Instantly share code, notes, and snippets.

@julioterra
Created October 5, 2011 17:41
Show Gist options
  • Select an option

  • Save julioterra/1265119 to your computer and use it in GitHub Desktop.

Select an option

Save julioterra/1265119 to your computer and use it in GitHub Desktop.
enumerable filter grouping methods
array = ["hi", "hello", "greetings", "bye", "goodbye"]
p array.group_by {|cur| cur.size}
p array.partition {|cur| cur.size > 5}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment