file1.txt
class Person
end
module Speak
end
The task is to printout all the constants listed in the file. In this
case there are Person and Speak.
I need to handle two cases.
-
The system loads the file for the first time. I guess in this case I
can use ObjectSpace.each_object or ObjectSpace.some_method from API to
get before and after picture. Subtract the before picture and I will get
the constants. -
The second case is when file1.txt is already loaded into the
application. So in this case I can’t do before and after thing. How can
I get constants in this case without before and after picture.
Thanks