Forgive my ignorance, but I must be missing something here. I can find the documentation for instance_eval for ruby 1.8.7 in the Object
class, but I just cannot find it anywhere for 1.9.2. I know the functionality is still supported since I'm using it. Is there some secret parent class that it has been moved to?
Asked
Active
Viewed 510 times
5

elmt
- 1,604
- 14
- 24
1 Answers
5
If you do Object.superclass
you will see that that is BasicObject
which itself has no superclass. Using BasicObject.public_methods
reveals that instance_eval
is defined there.
There does not seem to be any documentation for the methods on BasicObject
.

mikej
- 65,295
- 17
- 152
- 131
-
1Ahh I see. Is there any particular reason why the documentation doesn't exist? Are they trying to discourage the usage of `instance_eval`? I also noticed that `method_missing` is not documented anywhere? Also, the actual documentation for BasicObject is here: http://ruby-doc.org/core-1.9/classes/BasicObject.html. – elmt Jan 28 '11 at 09:32
-
2I spotted that link too, but the docs under /core-1.9 are for 1.9 whereas the docs under /core are for the latest (currently 1.9.2). It seems like the definition of `BasicObject` has moved from [object.c](https://github.com/ruby/ruby/blob/v1_9_0_0/object.c) to [class.c](https://github.com/ruby/ruby/blob/ruby_1_9_2/class.c) in the move from 1.9 to 1.9.2 so that might account for the small amount of documentation you can see in core-1.9. – mikej Jan 28 '11 at 09:50