How to save class in yaml as Hash or list?

M

meruby

Lets' face it: ruby in great language to program in. python has some
great library like matplotlib and others which has no equivalent in
ruby. But ruby has syck which can save data in yaml which can be use by
ruby or python program. So I like to save a ruby class in yaml to be
read by python program. How can I do that?

IMHO more and more people will use dynamic languages, syck will become
a vital tools to bridge gaps for data storage and retrival.
 
W

why the lucky stiff

So I like to save a ruby class in yaml to be read by python program. How can I do that?
Just output the object to YAML. PySyck can read in Ruby objects as
dictionaries. I'm not sure if PySyck guys have typing working yet.

If you are referring to dumping of classes, YAML cannot dump classes,
just as it cannot dump methods. YAML is not equipped with boundless
magic yet.

_why
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,474
Latest member
AntoniaDea

Latest Threads

Top