Hi --

On Mon, 19 May 2003, Gavin Sinclair wrote:

>
> >   class Foo
> >     def meth1 ...
> >     def meth2 ...
> >     def meth3 ...
> >     def meth4 ...
> >     def meth5 ...
> >     def meth6 ...
>
> >     private   :meth3, :meth4
> >     protected :meth5, :meth6
> >   end
>
>
> As a readability thing, I would prefer to declare the visibility of
> the methods up the top of the class (i.e. before defining them).  I
> like code-as-documentation.

However....

  irb(main):001:0> class A; private :x; def x; end; end
  NameError: undefined method `x' for class `A'
	  from (irb):1:in `private'
	  from (irb):1


David

-- 
David Alan Black
home: dblack / superlink.net
work: blackdav / shu.edu
Web:  http://pirate.shu.edu/~blackdav