My Snippets

To and From YAML

require 'yaml'

opts = { :first => 'Philippe', :last => 'Monnet'}

serialized = opts.to_yaml

twin_opts = YAML::load serialized

twin_opts.inspect # { :first => 'Philippe', :last => 'Monnet'}

April 4th, 2010 Posted by | ruby | no comments

No Comments

No comments yet.

Sorry, the comment form is closed at this time.