diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-27 20:40:12 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-27 20:40:12 +0000 |
commit | 430e0ce4913ad868d8c60ba3e5a0936d0f47af72 (patch) | |
tree | aa004448a5e67d2f9cc98211b6a31d9ef60c672a /ext/psych/lib/psych/deprecated.rb | |
parent | ad3c1061a78f6efe0ee3584d92b3df448da9891f (diff) |
* ext/psych/lib/psych/deprecated.rb: adding deprecated object_maker
method,
* test/psych/test_deprecated.rb: ditto
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych/deprecated.rb')
-rw-r--r-- | ext/psych/lib/psych/deprecated.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/psych/lib/psych/deprecated.rb b/ext/psych/lib/psych/deprecated.rb index dd4ca6b68f..f4034e32c0 100644 --- a/ext/psych/lib/psych/deprecated.rb +++ b/ext/psych/lib/psych/deprecated.rb @@ -66,6 +66,13 @@ module Psych end if name [type, reference] end + + def self.object_maker klass, hash + warn "#{caller[0]}: object_maker is deprecated" if $VERBOSE + klass.allocate.tap do |obj| + hash.each { |k,v| obj.instance_variable_set(:"@#{k}", v) } + end + end end class Object |