mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/ostruct.rb (OpenStruct#delete_field): also undefine
accessor methods. [ruby-core:33010] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
742d440cba
commit
4ec86dcc57
3 changed files with 21 additions and 1 deletions
|
@ -107,7 +107,9 @@ class OpenStruct
|
|||
# Remove the named field from the object.
|
||||
#
|
||||
def delete_field(name)
|
||||
@table.delete name.to_sym
|
||||
sym = name.to_sym
|
||||
@table.delete sym
|
||||
singleton_class.__send__(:remove_method, sym, "#{name}=")
|
||||
end
|
||||
|
||||
InspectKey = :__inspect_key__ # :nodoc:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue