Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. module Debug
  2. def whoAmI?
  3. "#{self.type.name} (##{self.id}): #{self.to_s}"
  4. end
  5. end
  6. class Phonograph
  7. include Debug
  8. # ...
  9. end
  10. class EightTrack
  11. include Debug
  12. # ...
  13. end
  14. ph = Phonograph.new("West End Blues")
  15. et = EightTrack.new("Surrealistic Pillow")
  16.  
  17. ph.whoAmI? → "Phonograph (#537766170): West End Blues"
  18. et.whoAmI? → "EightTrack (#537765860): Surrealistic Pillow"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement