Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
class Person include Comparable attr_accessor :name def initialize(name) @name = name end def <=>(other_person) self.name <=> other_person.name end def to_s "Hello my name is #{@name}" end end people = [Person.new("joe"),Person.new("mary"),Person.new("annie"),Person.new("bob")] sorted_people = people.sort sorted_people.each {|person| puts person }
From the Design Piracy series on my blog: