Skip to content

Instantly share code, notes, and snippets.

@blowmage
Created September 21, 2010 21:39
Show Gist options
  • Save blowmage/590629 to your computer and use it in GitHub Desktop.
Save blowmage/590629 to your computer and use it in GitHub Desktop.
Array#=~
a = [1, 2, 3]
b = [3, 2, 1]
class Array
def =~(other)
self.sort == other.sort
end
end
puts a =~ b #=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment