Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Debug
- def whoAmI?
- "#{self.type.name} (##{self.id}): #{self.to_s}"
- end
- end
- class Phonograph
- include Debug
- # ...
- end
- class EightTrack
- include Debug
- # ...
- end
- ph = Phonograph.new("West End Blues")
- et = EightTrack.new("Surrealistic Pillow")
- ph.whoAmI? → "Phonograph (#537766170): West End Blues"
- et.whoAmI? → "EightTrack (#537765860): Surrealistic Pillow"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement