T
thunk
Hi again,
SPECIFIC QUESTION:
How can I fetch the Class name of the calling Object?
(The module that contains the class of the calling Object might be
useful/necessary in the future.)
NOTES:
I checked the 'caller' stack and it doesn't show up there. Searched
this forum, googled, and it is was not found.
The calling Method was found right off.
A SNIPPIT FROM MY TEST CODE:
(this might provide some clue to the general utility?)
class TestingClass
def initialize
@wB = WhiteBoard.new
@satz1 =
end
def calling_method1
age = @wB.get_noteAGE, 19)
puts "defaulted age = " + age.to_s
@wB.put_notetest, 12)
@wB.put_notetest, 16) #just overwrites, handy?!
age = @wB.get_notetest)
puts "age = " + age.to_s # => 16
end
def calling_method2
@wB.set_id( :ALF )
@wB.put_satzTestingClass, :calling_method2, @satz1)
#put_satzAr(.... pushes the satz struct onto a automatic
stack
#would become just
#@wB.put_satz(@satz1)
#....if I could fetch the Class
end
def calling_method3
@wB.set_id( :ALF )
satz = @wB.get_satzTestingClass, :calling_method2)
puts "satz in calling_method3 = " + satz.inspect #(this
works)
end
end
SPECIFIC QUESTION:
How can I fetch the Class name of the calling Object?
(The module that contains the class of the calling Object might be
useful/necessary in the future.)
NOTES:
I checked the 'caller' stack and it doesn't show up there. Searched
this forum, googled, and it is was not found.
The calling Method was found right off.
A SNIPPIT FROM MY TEST CODE:
(this might provide some clue to the general utility?)
class TestingClass
def initialize
@wB = WhiteBoard.new
@satz1 =
end
def calling_method1
age = @wB.get_noteAGE, 19)
puts "defaulted age = " + age.to_s
@wB.put_notetest, 12)
@wB.put_notetest, 16) #just overwrites, handy?!
age = @wB.get_notetest)
puts "age = " + age.to_s # => 16
end
def calling_method2
@wB.set_id( :ALF )
@wB.put_satzTestingClass, :calling_method2, @satz1)
#put_satzAr(.... pushes the satz struct onto a automatic
stack
#would become just
#@wB.put_satz(@satz1)
#....if I could fetch the Class
end
def calling_method3
@wB.set_id( :ALF )
satz = @wB.get_satzTestingClass, :calling_method2)
puts "satz in calling_method3 = " + satz.inspect #(this
works)
end
end