This is a multi-part message in MIME format.
------ extPart_000_0005_01C03302.69442A40
Content-Type: text/plain;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
OK, here is what I think I know.
These three fragements differ only in that the last one defines a
private method, no?
class Object
def foo
...
end
end
def foo
...
end
def Object.foo
...
end
And isn't it true that a method like bar= must be called with a receiver?
Then why won't this work?
def bar=
...
end
self.bar = 5
It tells me that bar is private. Why? What is my fundamental misunderstanding?
Hal
------ extPart_000_0005_01C03302.69442A40
Content-Type: text/html;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2722.2800" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>OK, here is what I think I know.</DIV>
<DIV> </DIV>
<DIV>These three fragements differ only in that the last one defines
a</DIV>
<DIV>private method, no?</DIV>
<DIV> </DIV>
<DIV>class Object</DIV>
<DIV> def foo</DIV>
<DIV> ...</DIV>
<DIV> end</DIV>
<DIV>end</DIV>
<DIV> </DIV>
<DIV>def foo</DIV>
<DIV> ...</DIV>
<DIV>end</DIV>
<DIV> </DIV>
<DIV>def Object.foo</DIV>
<DIV> ...</DIV>
<DIV>end</DIV>
<DIV> </DIV>
<DIV>And isn't it true that a method like bar= must be called with a
receiver?</DIV>
<DIV>Then why won't this work?</DIV>
<DIV> </DIV>
<DIV>def bar=</DIV>
<DIV> ...</DIV>
<DIV>end</DIV>
<DIV> </DIV>
<DIV>self.bar = 5</DIV>
<DIV> </DIV>
<DIV>It tells me that bar is private. Why? What is my fundamental
misunderstanding?</DIV>
<DIV> </DIV>
<DIV>Hal</DIV>
<DIV> </DIV>
<DIV> </DIV></BODY></HTML>
------ extPart_000_0005_01C03302.69442A40--