[前][次][番号順一覧][スレッド一覧]

ruby-changes:51855

From: marcandre <ko1@a...>
Date: Fri, 27 Jul 2018 03:46:15 +0900 (JST)
Subject: [ruby-changes:51855] marcandRe: r64069 (trunk): lib/ostruct: Remove unnecessary `__send__`

marcandre	2018-07-27 03:46:10 +0900 (Fri, 27 Jul 2018)

  New Revision: 64069

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64069

  Log:
    lib/ostruct: Remove unnecessary `__send__`
    
    Patch by yuuji.yaginuma [Fix GH-1890]
    
    Since `remove_method` is public.
    Ref: https://bugs.ruby-lang.org/issues/14133

  Modified files:
    trunk/lib/ostruct.rb
Index: lib/ostruct.rb
===================================================================
--- lib/ostruct.rb	(revision 64068)
+++ lib/ostruct.rb	(revision 64069)
@@ -294,7 +294,7 @@ class OpenStruct https://github.com/ruby/ruby/blob/trunk/lib/ostruct.rb#L294
   def delete_field(name)
     sym = name.to_sym
     begin
-      singleton_class.__send__(:remove_method, sym, "#{sym}=")
+      singleton_class.remove_method(sym, "#{sym}=")
     rescue NameError
     end
     @table.delete(sym) do

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]