зеркало из https://github.com/github/ruby.git
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:
Родитель
781c3ca574
Коммит
5219adf4f1
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче