Work around this by representing a class by its name.
12
# File 'lib/dfect.rb', line 12 alias __to_yaml__ to_yaml
15 16 17 18 19 20 21
# File 'lib/dfect.rb', line 15 def to_yaml opts = {} begin __to_yaml__ rescue TypeError => e self.name.to_yaml opts end end