All pastes #342844 Raw Edit

Untitled

public text v1 · immutable
·published 2007-02-06 16:22 UTC
rendered paste body
require '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