summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-05-03 08:17:12 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-05-03 08:17:12 -0700
commit17b2deaa6e487e565d43c526a50d9974a54f5bbd (patch)
tree66e89731f4f0b70856adcb1d4abc7dbd9a14ae6f /lib
parent88bcb83729ebea6a7d4581b3100dfa7a783a9ff7 (diff)
downloadpsych-17b2deaa6e487e565d43c526a50d9974a54f5bbd.zip
merging from ruby
Diffstat (limited to 'lib')
-rw-r--r--lib/psych/deprecated.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/psych/deprecated.rb b/lib/psych/deprecated.rb
index 1d401d9..f4034e3 100644
--- a/lib/psych/deprecated.rb
+++ b/lib/psych/deprecated.rb
@@ -56,6 +56,23 @@ module Psych
return thing unless String === thing
"tag:yaml.org,2002:#{thing}"
end
+
+ def self.read_type_class type, reference
+ warn "#{caller[0]}: read_type_class is deprecated" if $VERBOSE
+ _, _, type, name = type.split ':', 4
+
+ reference = name.split('::').inject(reference) do |k,n|
+ k.const_get(n.to_sym)
+ 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