Hugh Sasse
11/10/2008 9:32:00 PM
On Tue, 11 Nov 2008, Carter Davis wrote:
> I made all the changes to the test app and ran it, and here's what it
> gave me:
>
> before class : main
> inside class : FirstClass
> YAY INITIALIZE!
> in initialize : #<FirstClass:0x28dac>
> example.rb:18: private method `test' called for #<FirstClass:0x28dac>
My mistake: I misread your method name as test when it is text.
s/s/x/; # as they say in the Unix world!
So before the class statement, your object is main (actually within
the class Object.
Between class...end (the matching end, your object self is FirstClass,
so that all method calls will go to that class first.
When you run the text [not test :-)] method, your object is <FirstClass:0x23dac>( that is, an instance of Firstclass). You call the methods on it with .
Does that answer your question(s)?
> (NoMethodError)
>
Hugh