Untitled
public text v1 · immutablerequire 'yaml'
class HappyClass
end
happy = HappyClass.new
File.open("happy.txt", "a") do |f|
f << happy.to_yaml
end
File.open("happy.txt") do |f|
happy2 = YAML.load(f)
puts "Deserialized #{happy2.class}"
end