Guest User

Untitled

a guest
Feb 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. # encoding: utf-8
  2. alias :"✎" :puts
  3. class Person
  4. attr_accessor :name
  5. def initialize(a_name)
  6. self.name = a_name
  7. end
  8. def ☺(someone)
  9. ✎ "#{self} loves #{someone}"
  10. end
  11. def ☹(someone)
  12. ✎ "#{self} hates #{someone}"
  13. end
  14. def ☞(someone)
  15. ✎ "#{self} blames #{someone}"
  16. end
  17. def to_s
  18. name
  19. end
  20. end
  21. john = Person.new "John"
  22. bob = Person.new "Bob"
  23. jane = Person.new 'Jane'
  24.  
  25. john.☺(bob)
  26. bob.☹(john)
  27. jane.☞(bob)
Add Comment
Please, Sign In to add comment