public Method

Module.protected(...)

protected                 self
protected(symbol, ...)    self

With no arguments, sets the default visibility for subsequently defined methods to protected. With arguments, sets the named methods to have protected visibility.

Source Code

/*
*  call-seq:
*     protected                => self
*     protected(symbol, ...)   => self
*  
*  With no arguments, sets the default visibility for subsequently
*  defined methods to protected. With arguments, sets the named methods
*  to have protected visibility.
*/

static VALUE
rb_mod_protected(argc, argv, module)
   int argc;
   VALUE *argv;
   VALUE module;
{
   secure_visibility(module);
   if (argc == 0) {
       SCOPE_SET(SCOPE_PROTECTED);
   }
   else {
       set_method_visibility(module, argc, argv, NOEX_PROTECTED);
   }
   return module;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.