Created
September 23, 2008 15:22
-
-
Save djanowski/12305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Ancestor | |
attr_accessor :id | |
def initialize(id) | |
@id = id | |
end | |
def ==(other) | |
id == other.id | |
end | |
end | |
class Foo < Ancestor | |
def initialize(id) | |
@id = id | |
end | |
end | |
class Bar < Ancestor | |
include Comparable | |
end | |
Foo.new(1) == Foo.new(1) | |
Bar.new(1) == Bar.new(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment