Skip to content

Instantly share code, notes, and snippets.

@philk
Created August 23, 2012 18:22
Show Gist options
  • Select an option

  • Save philk/3439863 to your computer and use it in GitHub Desktop.

Select an option

Save philk/3439863 to your computer and use it in GitHub Desktop.
Sorted each lol
class Array
def seach
self.sort.each do |a|
yield a
end
end
end
[2,1,3].seach do |i|
puts i
end
#=> 1
#=> 2
#=> 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment