#ruby 1.9
class Person
  def initialize(name)
    @name = name
    @where = "don't know" #
  end

  def report
    print "\n", @name, " instantiated in: ", @where, "\n"
  end
end

p = Person.new("Nancy")
p.report

-

What I'm looking for:

how can I detect WHERE the object was instantiated?

 * module
 * class
 * file name
 * line number
 *
something like

  def initialize(name)
    @name = name
    @where = self.execution.called_from # Object
    @where = self.execution.file_name # String with filename

.

--
http://lazaridis.com