ruby-changes:45792
From: naruse <ko1@a...>
Date: Sun, 12 Mar 2017 02:37:51 +0900 (JST)
Subject: [ruby-changes:45792] naruse:r57865 (ruby_2_4): merge revision(s) 57375:
naruse 2017-03-12 02:37:46 +0900 (Sun, 12 Mar 2017) New Revision: 57865 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57865 Log: merge revision(s) 57375: More description about the protected attribute of a method Modified directories: branches/ruby_2_4/ Modified files: branches/ruby_2_4/version.h branches/ruby_2_4/vm_method.c Index: ruby_2_4/vm_method.c =================================================================== --- ruby_2_4/vm_method.c (revision 57864) +++ ruby_2_4/vm_method.c (revision 57865) @@ -1669,6 +1669,15 @@ rb_mod_public(int argc, VALUE *argv, VAL https://github.com/ruby/ruby/blob/trunk/ruby_2_4/vm_method.c#L1669 * defined methods to protected. With arguments, sets the named methods * to have protected visibility. * String arguments are converted to symbols. + * + * If a method has protected visibility, it is callable only where + * <code>self</code> of the context is the same as the method. + * (method definition or instance_eval). This behavior is different from + * Java's protected method. Usually <code>private</code> should be used. + * + * Note that a protected method is slow because it can't use inline cache. + * + * To show a private method on RDoc, use <code>:doc:</code> instead of this. */ static VALUE @@ -1696,6 +1705,8 @@ rb_mod_protected(int argc, VALUE *argv, https://github.com/ruby/ruby/blob/trunk/ruby_2_4/vm_method.c#L1705 * private :a * end * Mod.private_instance_methods #=> [:a, :c] + * + * Note that to show a private method on RDoc, use <code>:doc:</code>. */ static VALUE Index: ruby_2_4/version.h =================================================================== --- ruby_2_4/version.h (revision 57864) +++ ruby_2_4/version.h (revision 57865) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_4/version.h#L1 #define RUBY_VERSION "2.4.0" #define RUBY_RELEASE_DATE "2017-03-12" -#define RUBY_PATCHLEVEL 30 +#define RUBY_PATCHLEVEL 31 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 3 Property changes on: ruby_2_4 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r57375 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/