From: Surendra Singhi Date: 2006-03-01T23:57:53+09:00 Subject: ruby modules and classes Hello, When I try the code below I get an error. Why is it so? Am I misunderstanding how modules behave? How should the module be written so that `who_am_i' is added as a method to the class Phonograph. module Debug def self.who_am_i? "#{self.class.name} (\##{self.id}): #{self.to_s}" end end class Phonograph include Debug end Phonograph.who_am_i? Thanks. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read the latest news at: http://news.kreeti.com ,---- | "O thou my friend! The prosperity of Crime is like unto the lightning, | whose traitorous brilliancies embellish the atmosphere but for an | instant, in order to hurl into death's very depths the luckless one | they have dazzled." -- Marquis de Sade `----