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:
parent
781c3ca574
commit
5219adf4f1
1 changed files with 1 additions and 1 deletions
|
@ -294,7 +294,7 @@ class OpenStruct
|
||||||
def delete_field(name)
|
def delete_field(name)
|
||||||
sym = name.to_sym
|
sym = name.to_sym
|
||||||
begin
|
begin
|
||||||
singleton_class.__send__(:remove_method, sym, "#{sym}=")
|
singleton_class.remove_method(sym, "#{sym}=")
|
||||||
rescue NameError
|
rescue NameError
|
||||||
end
|
end
|
||||||
@table.delete(sym) do
|
@table.delete(sym) do
|
||||||
|
|
Loading…
Reference in a new issue