A brief and basic introduction to the syntax of Ruby 1.8, along with a few nice language features. This is a talk I gave at one of our first Rochester on Rails meetings.
32. Mixins module Debug def whoAmI? “ #{self.type.name} ” + “ (#{self.id}): ” + “ #{self.to_s}" end end
33. Mixins class Phonograph include Debug # ... end ph = Phonograph.new("West End Blues") ph.whoAmI? "Phonograph (#537766170): West End Blues"