From: Sean Russell Date: 2002-05-25T01:16:32+09:00 Subject: Re: confused about access control Alan Chen wrote: > foo is an instance of String, but Foo isn't a subclass of String. > Even if Foo were a subclass of String, foo.undot! is trying to publically > access the undot! method. Or, to put it another way: >> irb(main):007:0> class Foo >> irb(main):008:1> foo = '..123' >> irb(main):009:1> foo.undot! >> irb(main):010:1> end .... >> "Protected methods can be invoked only by objects of the defining >> class and its subclasses." The object that is /invoking/ undot! is Foo, not foo, and Foo has nothing to do with String. -- |.. "To understand recursion, you need to understand recursion." <|> -- anon /|\ /| |