1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
marcandre 2018-07-26 18:46:10 +00:00
parent 781c3ca574
commit 5219adf4f1

View file

@ -294,7 +294,7 @@ class OpenStruct
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