diff options
Diffstat (limited to 'ext')
-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 |