1
0
Fork 0
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:
nobu 2010-11-03 05:17:25 +00:00
parent 742d440cba
commit 4ec86dcc57
3 changed files with 21 additions and 1 deletions

View file

@ -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: