aboutsummaryrefslogtreecommitdiffstats
path: root/ext/psych/lib/psych/visitors/to_ruby.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-09 00:06:29 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-09 00:06:29 +0000
commitc641e4b23e674e784258b1b3a86df5fb1091753a (patch)
tree0f642ab8f0571076efe5d94ceefb22b4467dbaf8 /ext/psych/lib/psych/visitors/to_ruby.rb
parentc84bb5df6dff60d17ff692306aa94fd53bed9638 (diff)
downloadruby-c641e4b23e674e784258b1b3a86df5fb1091753a.tar.gz
* ext/psych/lib/psych/visitors/to_ruby.rb: Ruby classes can be loaded
from YAML files. * ext/psych/lib/psych/visitors/yaml_tree.rb: Ruby classes can be dumped to YAML files. * test/psych/test_class.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31958 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib/psych/visitors/to_ruby.rb')
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index f8b15859e1..cb0afd26ba 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -57,6 +57,8 @@ module Psych
Complex(o.value)
when "!ruby/object:Rational"
Rational(o.value)
+ when "!ruby/class"
+ resolve_class o.value
when "tag:yaml.org,2002:float", "!float"
Float(@ss.tokenize(o.value))
when "!ruby/regexp"