Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

PStore.new

new(file, thread_safe = false)

Returns a new PStore object.

Argument file is the path to the file in which objects are to be stored; if the file exists, it should be one that was written by PStore.

Example
path = 't.store'
store = PStore.new(path)

A PStore object is reentrant. If argument thread_safe is given as true, the object is also thread-safe (at the cost of a small performance penalty):

Example
store = PStore.new(path, true)
See also #[] #[]= also in 3.4 · 3.3 · 3.1 · 3.0