Chris Pine :

> And definitely let us know if you get stuck again!  It's hard to know
> how much to "give away", but we're always happy to help.
>
> Happy Rubying,
>
> Chris

I'd like to do happy-rubying.. :-)

I wrote Accounts class for testing the private method scope as is
written
in the online book "Programming Ruby: Pragramatic ..." But in the
course
of the testing I've come across the problem as I questioned before.

Because the problem's gone, I'd like to ask questions as I intended
in the first place. Please bear with me If my question is a really
newbie
one.

This is a excerpt from the "Access Control" section of
"Classes,Objects,and Variables":
If a method is private, it may be called only within the context of the
calling
object--it is never possible to access another object's private method
directly,
even if the object is of the same class as the caller.

So... Could you explain the concept more clearly:
 "within the context of the callling object"
?

And how can I write a statement which acess another object's private
method
directly?

If I define the class like this:
class A
 private
   def privAMethod
   end
end

we can make a new instance

a = A.new()

but, can't call the private method.

a.privAMethod

In the above "a.privAMethod" is a expression that access its own
private method
(anyway though this is not allowed)
, not another objects.

Does it make any sense to say "accessing another objects private
method"?
Any such expression example?

Hmm. maybe this is not an important question nor worth being asked...


Thanks a lot.
SYLee.