On 26/03/2008, Peña, Botp <[EMAIL PROTECTED]> wrote:

>  qri is your friend
>
>  [EMAIL PROTECTED]:~$ qri private
>  --------------------------------------------------------- Module#private
>      private                 => self
>      private(symbol, ...)    => self
>  ------------------------------------------------------------------------
>      With no arguments, sets the default visibility for subsequently
>      defined methods to private. With arguments, sets the named methods
>      to have private visibility.
>
>         module Mod
>           def a()  end
>           def b()  end
>           private
>           def c()  end
>           private :a
>         end
>         Mod.private_instance_methods   #=> ["a", "c"]

if it's only about a method then it's trivial, what I meant was
something like this.

private(*somethingsomething)

anyone can explain it to me more clear?

m:lib arie$ rak "private\(" rake.rb
1091|private(*FileUtils.instance_methods(false))
1092|private(*RakeFileUtils.instance_methods(false))

oh wait, sorry for the noise, I know the answer! so private also
accepts an array of string values which are method names. Thanks for
the clue :-)

>  kind regards -botp

-- 
blog: http://tinyurl.com/2bjgvn,
ruby: http://www.ruby-lang.org/id/about

I always thought Smalltalk would beat Java, I just didn't know it
would be called 'Ruby' when it did. -- Kent Beck.

Kirim email ke