L
Luca Pireddu
Hello. Can someone point me to some documentation describing how to add YAML
support to a class? I have a class that contains an RGL graph. I'd like to
be able to save it and restore it, but
YAML::dump(RGL:irectedAdjacencyGraph.new)
throws an exception
TypeError: can't dump anonymous class Class
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:9:in `to_yaml'
from /usr//lib/ruby/1.8/yaml/baseemitter.rb:181:in `map'
from /usr//lib/ruby/1.8/yaml/baseemitter.rb:170:in `each'
from /usr//lib/ruby/1.8/yaml/baseemitter.rb:170:in `map'
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:25:in `to_yaml'
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:24:in `call'
from /usr//lib/ruby/1.8/yaml.rb:373:in `quick_emit'
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:24:in `to_yaml'
from /usr//lib/ruby/1.8/yaml.rb:103:in `dump'
TIA.
Luca
support to a class? I have a class that contains an RGL graph. I'd like to
be able to save it and restore it, but
YAML::dump(RGL:irectedAdjacencyGraph.new)
throws an exception
TypeError: can't dump anonymous class Class
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:9:in `to_yaml'
from /usr//lib/ruby/1.8/yaml/baseemitter.rb:181:in `map'
from /usr//lib/ruby/1.8/yaml/baseemitter.rb:170:in `each'
from /usr//lib/ruby/1.8/yaml/baseemitter.rb:170:in `map'
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:25:in `to_yaml'
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:24:in `call'
from /usr//lib/ruby/1.8/yaml.rb:373:in `quick_emit'
from /usr//lib/ruby/1.8/yaml/rubytypes.rb:24:in `to_yaml'
from /usr//lib/ruby/1.8/yaml.rb:103:in `dump'
TIA.
Luca