aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-31 05:37:21 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-31 05:37:21 +0000
commit2f2a5c3ae9f9e7a4d09b1500de8d864f48d69cad (patch)
tree99f8057a25387d3cf7ec58a6fd53cb41bda03b2b /lib/ostruct.rb
parent99894e6c82054c893e6c9f5bccc181b97b8120ee (diff)
downloadruby-2f2a5c3ae9f9e7a4d09b1500de8d864f48d69cad.tar.gz
* lib/ostruct.rb: Fix new_ostruct_member to correctly avoid redefinition
[#11901] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index e7b8ed4609..e5b69608ad 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -168,7 +168,7 @@ class OpenStruct
#
def new_ostruct_member(name)
name = name.to_sym
- unless respond_to?(name)
+ unless singleton_class.method_defined?(name)
define_singleton_method(name) { @table[name] }
define_singleton_method("#{name}=") { |x| modifiable[name] = x }
end