From: Mario Ruiz Date: 2012-11-28T20:51:15+09:00 Subject: Re: How to know in which class we are when inheriting Well, it is more complicated what i want to do... but doint it like you said i got the first class where all the others are inheriting from... and that's not what i want. Take a look at this example more similar to the thing I need: (I need to know that what is failing is the setup on class Two) require 'test/unit' #This is the TestCase class inside the framework i'm developing class TestCase < Test::Unit::TestCase undef_method :default_test def whoami return method(:whoami).owner end def assert(value,*message) report(value,message.join) return super(value,message.join) end def report(value,*message) if value==false then puts "*" * 20 puts whoami puts "#" * 20 end end end #I want people to write testcases using my new testcase class, like these ones class One < TestCase def setup super() assert(true,"blabla") end end class Two < One def setup super() assert(false,"dos") end end class MyTestCase < Two def test01 assert(true,"hola") end end Jan E. wrote in post #1086850: > Hi, > > the "self" keyword is always resolved in the current context. So when > you call an inherited method or super(), "self" always points to the > current instance and not the originating class or something. This -- Posted via http://www.ruby-forum.com/.