Skip to content

Instantly share code, notes, and snippets.

@Raynes Raynes/gist:206429
Created Oct 9, 2009

Embed
What would you like to do?
class Person
include Comparable
attr_reader :name
def initialize(name)
@name = name
end
def to_s
"#{@name}"
end
def <=>(other)
self.name <=> other.name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.