Method: Module#public

Defined in:
vm_method.c

#publicnil (private) #public(method_name) ⇒ Object (private) #public(method_name, method_name, ...) ⇒ Array (private) #public(array) ⇒ Array (private)

With no arguments, sets the default visibility for subsequently defined methods to public. With arguments, sets the named methods to have public visibility. String arguments are converted to symbols. An Array of Symbols and/or Strings is also accepted. If a single argument is passed, it is returned. If no argument is passed, nil is returned. If multiple arguments are passed, the arguments are returned as an array.

Overloads:

  • #publicnil

    Returns:

    • (nil)
  • #public(method_name, method_name, ...) ⇒ Array

    Returns:

  • #public(array) ⇒ Array

    Returns:



2461
2462
2463
2464
2465
# File 'vm_method.c', line 2461

static VALUE
rb_mod_public(int argc, VALUE *argv, VALUE module)
{
    return set_visibility(argc, argv, module, METHOD_VISI_PUBLIC);
}