Skip to content

Instantly share code, notes, and snippets.

@tobowers
Created September 15, 2014 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobowers/e006020d9365d37e8491 to your computer and use it in GitHub Desktop.
Save tobowers/e006020d9365d37e8491 to your computer and use it in GitHub Desktop.
a quick select implementation
class Array
def select(&block)
new_array = []
self.each do |array_element|
new_array << array_element if block.call(array_element)
end
new_array
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment