Skip to content

Instantly share code, notes, and snippets.

@djanowski
Created September 23, 2008 15:22
Show Gist options
  • Save djanowski/12305 to your computer and use it in GitHub Desktop.
Save djanowski/12305 to your computer and use it in GitHub Desktop.
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