P
Paul
A private method cannot be called with an explicit receiver -- even
self -- except when calling a private setter method, because otherwise
an assignment to a local variable will be assumed.
For example:
-----------------------
class Q
def a1
@p = nil
self.p=(3)
@p
end
def a2
@p = nil
p=(3)
@p
end
private
def p=(obj)
@p = obj
end
end
self -- except when calling a private setter method, because otherwise
an assignment to a local variable will be assumed.
For example:
-----------------------
class Q
def a1
@p = nil
self.p=(3)
@p
end
def a2
@p = nil
p=(3)
@p
end
private
def p=(obj)
@p = obj
end
end