purge(key)
click to toggle source
def purge(key)
@hash.delete(key)
nil
end
read(key)
click to toggle source
def read(key)
if data = @hash[key]
Marshal.load(data)
else
[]
end
end
to_hash()
click to toggle source
write(key, entries)
click to toggle source
def write(key, entries)
@hash[key] = Marshal.dump(entries)
end