Skip to content

Instantly share code, notes, and snippets.

@GeekOnCoffee
Created May 31, 2013 13:16
Show Gist options
  • Save GeekOnCoffee/5684908 to your computer and use it in GitHub Desktop.
Save GeekOnCoffee/5684908 to your computer and use it in GitHub Desktop.
PStore
{:id=>"580485385", :idDomain=>"QB"}
"R801382384"
{:id=>"073411161", :idDomain=>"QB"}
"R307406722"
{:id=>"237431841", :idDomain=>"QB"}
"R782613781"
{:id=>"370276320", :idDomain=>"QB"}
require "pstore"
xref = PStore.new("xref.pstore")
xref.transaction do
xref["R#{Array.new(9){rand(9)}.join}"] = {:id => Array.new(9){rand(9)}.join, :idDomain => "QB"}
end
xref.transaction(true) do
xref.roots.each do |data_root_name|
p data_root_name
p xref[data_root_name]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment