Save and retrieve data with pstore : pstore « Database « Ruby






Save and retrieve data with pstore


require "pstore"

db = PStore.new("employee.dat")
db.transaction do
    db["params"] = {"name" => "Fred", "age" => 32,
                    "salary" => 48000 }
end


# retrieve
require "pstore"
db = PStore.new("employee.dat")
emp = nil
db.transaction { emp = db["params"] }

 








Related examples in the same category