summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/psych/ruby.rb2
-rw-r--r--lib/psych/visitors/yast_builder.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/psych/ruby.rb b/lib/psych/ruby.rb
index 97734f5..896c185 100644
--- a/lib/psych/ruby.rb
+++ b/lib/psych/ruby.rb
@@ -1,4 +1,4 @@
-[Object, String].each do |klass|
+[Object, String, Class].each do |klass|
klass.send(:remove_method, :to_yaml)
end
diff --git a/lib/psych/visitors/yast_builder.rb b/lib/psych/visitors/yast_builder.rb
index 65ed594..df6d390 100644
--- a/lib/psych/visitors/yast_builder.rb
+++ b/lib/psych/visitors/yast_builder.rb
@@ -23,6 +23,10 @@ module Psych
visitor_for(::String) do |o|
@stack.last.children << Nodes::Scalar.new(o)
end
+
+ visitor_for(::Class) do |o|
+ raise TypeError, "can't dump anonymous class #{o.class}"
+ end
end
end
end