Skip to content

Instantly share code, notes, and snippets.

@kirel
Created January 2, 2013 14:37
Show Gist options
  • Select an option

  • Save kirel/4434977 to your computer and use it in GitHub Desktop.

Select an option

Save kirel/4434977 to your computer and use it in GitHub Desktop.
class A
def == other
puts 'foo'
end
end
class B < A
alias_method :"__==__", :"=="
include Comparable
alias_method :"==", :"__==__"
def <=> other
puts 'bar'
1
end
end
B.new == 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment