From: Nikodemus Siivola Date: 2002-05-23T17:21:03+09:00 Subject: RE: confused about access control On Thu, 23 May 2002, Mike Campbell wrote: > foo (lowercase) IS a[n instance of] String, right? So why can't an > instance of String call a protected method of String? I don't think the > enclosing "Foo" class definition is relevant here, is it? You are confusing caller and receiver. The caller is the "enclosing" object and receiver is the object whose method is being called: think of caller being analogous to scope and receiver being analogous to an lvalue. class Caller < SuperKlass def calling_method receiver.foobar # <-- receiver is the object left of the dot. end # and caller is an instance of Caller. end Now, if receiver is an instance of SuperKlass or Caller, the method "foobar" may be protected. Any help? -- Nikodemus