Skip to content

Instantly share code, notes, and snippets.

@zmalltalker
Created September 4, 2008 07:59
Show Gist options
  • Save zmalltalker/8735 to your computer and use it in GitHub Desktop.
Save zmalltalker/8735 to your computer and use it in GitHub Desktop.
# encoding: utf-8
alias :"✎" :puts
class Person
attr_accessor :name
def initialize(a_name)
self.name = a_name
end
def ☺(someone)
✎ "#{self} loves #{someone}"
end
def ☹(someone)
✎ "#{self} hates #{someone}"
end
def ☞(someone)
✎ "#{self} blames #{someone}"
end
def to_s
name
end
end
john = Person.new "John"
bob = Person.new "Bob"
jane = Person.new 'Jane'
john.☺(bob)
bob.☹(john)
jane.☞(bob)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment