Method: PStore#delete

Defined in:
lib/pstore.rb

#delete(key) ⇒ Object

Removes and returns the value at key if it exists:

example_store do |store|
  store.transaction do
    store[:bat] = 3
    store.delete(:bat)
  end
end

Returns nil if there is no such key.

Raises an exception if called outside a transaction block.



476
477
478
479
# File 'lib/pstore.rb', line 476

def delete(key)
  in_transaction_wr
  @table.delete key
end