Skip to content

Instantly share code, notes, and snippets.

@burke
Created January 28, 2010 14:38
Show Gist options
  • Save burke/288792 to your computer and use it in GitHub Desktop.
Save burke/288792 to your computer and use it in GitHub Desktop.
def newmethod(candidate, set_arr)
set_arr.each_with_index.inject([]) do |a, v|
a << v[1] if v[0] == candidate
a
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment