Skip to content

Instantly share code, notes, and snippets.

@Raynes
Created October 9, 2009 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Raynes/206429 to your computer and use it in GitHub Desktop.
Save Raynes/206429 to your computer and use it in GitHub Desktop.
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