diff options
author | Yusuke Endoh <mame@ruby-lang.org> | 2020-12-24 00:15:29 +0900 |
---|---|---|
committer | Yusuke Endoh <mame@ruby-lang.org> | 2020-12-24 00:15:29 +0900 |
commit | 3a81daaf8dc037057d96b8e8cdc6ab1691e7e9d9 (patch) | |
tree | 017fceb114ca701958006203955208e838d6ecae /vm_method.c | |
parent | 94015200b69820575c8b11d4181d397b033b69ac (diff) |
Module#public_class_method also accepts a symbol array as an argument
I'm unsure if this is intentional, but add a document anyway.
[Feature #17314]
Diffstat (limited to 'vm_method.c')
-rw-r--r-- | vm_method.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vm_method.c b/vm_method.c index a0ccdb8a51..4e1208b4c2 100644 --- a/vm_method.c +++ b/vm_method.c @@ -2035,6 +2035,7 @@ set_visibility(int argc, const VALUE *argv, VALUE module, rb_method_visibility_t * 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 are also accepted. */ static VALUE @@ -2054,6 +2055,7 @@ rb_mod_public(int argc, VALUE *argv, VALUE module) * defined methods to protected. With arguments, sets the named methods * to have protected visibility. * String arguments are converted to symbols. + * An Array of Symbols and/or Strings are also accepted. * * If a method has protected visibility, it is callable only where * <code>self</code> of the context is the same as the method. @@ -2082,6 +2084,7 @@ rb_mod_protected(int argc, VALUE *argv, VALUE module) * defined methods to private. With arguments, sets the named methods * to have private visibility. * String arguments are converted to symbols. + * An Array of Symbols and/or Strings are also accepted. * * module Mod * def a() end @@ -2214,10 +2217,12 @@ rb_mod_ruby2_keywords(int argc, VALUE *argv, VALUE module) * call-seq: * mod.public_class_method(symbol, ...) -> mod * mod.public_class_method(string, ...) -> mod + * mod.public_class_method(array) -> mod * * Makes a list of existing class methods public. * * String arguments are converted to symbols. + * An Array of Symbols and/or Strings are also accepted. */ static VALUE @@ -2231,11 +2236,13 @@ rb_mod_public_method(int argc, VALUE *argv, VALUE obj) * call-seq: * mod.private_class_method(symbol, ...) -> mod * mod.private_class_method(string, ...) -> mod + * mod.private_class_method(array) -> mod * * Makes existing class methods private. Often used to hide the default * constructor <code>new</code>. * * String arguments are converted to symbols. + * An Array of Symbols and/or Strings are also accepted. * * class SimpleSingleton # Not thread safe * private_class_method :new @@ -2258,12 +2265,14 @@ rb_mod_private_method(int argc, VALUE *argv, VALUE obj) * public * public(symbol, ...) * public(string, ...) + * public(array) * * 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 are also accepted. */ static VALUE @@ -2277,12 +2286,14 @@ top_public(int argc, VALUE *argv, VALUE _) * private * private(symbol, ...) * private(string, ...) + * private(array) * * With no arguments, sets the default visibility for subsequently * defined methods to private. With arguments, sets the named methods to * have private visibility. * * String arguments are converted to symbols. + * An Array of Symbols and/or Strings are also accepted. */ static VALUE top_private(int argc, VALUE *argv, VALUE _) |