Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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)
Add Comment
Please, Sign In to add comment