Thanks a lot David!

I would like to make another question please...:)

If i just change Modules's name for Father for example:

class Father
  @@docs = {}
  def doc(str)
    @@docs[self.name] = self.name + ":\n" + str.gsub(/^\s+/, '')
  end
  def Father::show_doc(aClass)
    aClass = aClass.name if aClass.class <= Module
    @@docs[aClass] || "No documentation for #{aClass}"
  end
end
class Example<Father
  doc("This is a sample documentation string")
end

puts Father::show_doc(Example)

Produces:

undefined method `doc' for Example:Class (NoMethodError)

Can you tell why? :)


-- 
Posted via http://www.ruby-forum.com/.