ruby-changes:51843
From: tenderlove <ko1@a...>
Date: Thu, 26 Jul 2018 03:06:33 +0900 (JST)
Subject: [ruby-changes:51843] tenderlove:r64057 (trunk): Remove obsolete comment from Module#define_method documentation
tenderlove 2018-07-26 03:06:29 +0900 (Thu, 26 Jul 2018) New Revision: 64057 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64057 Log: Remove obsolete comment from Module#define_method documentation Since 2.5, Module#define_method is public. (feature #14133) Co-Authored-By: Miguel Landaeta <miguel@m...> Modified files: trunk/proc.c Index: proc.c =================================================================== --- proc.c (revision 64056) +++ proc.c (revision 64057) @@ -1853,16 +1853,14 @@ rb_mod_public_instance_method(VALUE mod, https://github.com/ruby/ruby/blob/trunk/proc.c#L1853 * Defines an instance method in the receiver. The _method_ * parameter can be a +Proc+, a +Method+ or an +UnboundMethod+ object. * If a block is specified, it is used as the method body. This block - * is evaluated using <code>instance_eval</code>, a point that is - * tricky to demonstrate because <code>define_method</code> is private. - * (This is why we resort to the +send+ hack in this example.) + * is evaluated using <code>instance_eval</code>. * * class A * def fred * puts "In Fred" * end * def create_method(name, &block) - * self.class.send(:define_method, name, &block) + * self.class.define_method(name, &block) * end * define_method(:wilma) { puts "Charge it!" } * end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/