diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-29 03:48:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-29 03:48:36 +0000 |
commit | 15960b37e82ba60455c480b1c23e1567255d3e05 (patch) | |
tree | d65ca77efdc1fe08e2d81aee9675d2ac6426499e /lib/ostruct.rb | |
parent | 88aa6abf9c1afa2e14bec5f4bfb64357cb9c1052 (diff) | |
download | ruby-15960b37e82ba60455c480b1c23e1567255d3e05.tar.gz |
ostruct.rb: respond_to?
* lib/ostruct.rb (OpenStruct): make respond_to? working on
just-allocated objects for workaround of Psych.
[ruby-core:72501] [Bug #11884]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53366 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r-- | lib/ostruct.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb index 5aea0465bd..e7b8ed4609 100644 --- a/lib/ostruct.rb +++ b/lib/ostruct.rb @@ -71,6 +71,11 @@ # of these properties compared to using a Hash or a Struct. # class OpenStruct + # :nodoc: + class << self + alias allocate new + end + # # Creates a new OpenStruct object. By default, the resulting OpenStruct # object will have no attributes. |