B
Bertram Scharpf
Hi, experts,
how can I find out what my current class context is?
I say:
class C ; end
C.instance_eval { def f ; "f" ; end }
C.f
#=> "f"
class D ; end
D.class_eval { def f ; "f" ; end }
D.new.f
#=> "f"
Obviously the method will be put into another context
either. I would like to be able to ask what the context is
_before_ I define the method. `self' seems to be the same in
both cases.
Sorry, it's my itch that I want to know the whole truth.
Thanks in advance.
Bertram
how can I find out what my current class context is?
I say:
class C ; end
C.instance_eval { def f ; "f" ; end }
C.f
#=> "f"
class D ; end
D.class_eval { def f ; "f" ; end }
D.new.f
#=> "f"
Obviously the method will be put into another context
either. I would like to be able to ask what the context is
_before_ I define the method. `self' seems to be the same in
both cases.
Sorry, it's my itch that I want to know the whole truth.
Thanks in advance.
Bertram