A couple of questions regarding the top-level environment of execution.
The Pickaxe says on page 376 that top-level methods are defined as
private instance methods of Object, whereas Ruby for Rails says on
page 203 they are private instance methods of the Kernel module. Which
one is correct?
Which is the actual container of a top-level constant?
A couple of questions regarding the top-level environment of execution.
The Pickaxe says on page 376 that top-level methods are defined as private
instance methods of Object, whereas Ruby for Rails says on page 203 they are
private instance methods of the Kernel module. Which one is correct?
The Pickaxe is right. I believe it got fixed in later printings of
R4R, though. I can’t remember what led to the original mistake – I
think I misinterpreted some method-list output I was getting while
examining it all in irb, or something.
Which is the actual container of a top-level constant?
You may not want me to answer But I do believe it’s Object.
A couple of questions regarding the top-level environment of execution.
The Pickaxe says on page 376 that top-level methods are defined as
private instance methods of Object, whereas Ruby for Rails says on
page 203 they are private instance methods of the Kernel module. Which
one is correct?