store

gdbm.store(key, value) â value Instance Public methods Associates the value value with the specified key.

size

gdbm.size â fixnum Instance Public methods Returns the number of key-value pairs in this database.

shift

gdbm.shift â (key, value) or nil Instance Public methods Removes a key-value-pair from this database and returns it as a two-item array [ key, value ]. Returns nil if the database is empty.

select

gdbm.select { |key, value| block } â array Instance Public methods Returns a new array of all key-value pairs of the database for which block evaluates to true.

replace

gdbm.replace(other) â gdbm Instance Public methods Replaces the content of gdbm with the key-value pairs of other. other must have an #each_pair method.

reorganize

gdbm.reorganize â gdbm Instance Public methods Reorganizes the database file. This operation removes reserved space of elements that have already been deleted. It is only useful after a lot of deletions in the database.

reject!

gdbm.reject! { |key, value| block } â gdbm Instance Public methods Deletes every key-value pair from gdbm for which block evaluates to true.

reject

gdbm.reject { |key, value| block } â hash Instance Public methods Returns a hash copy of gdbm where all key-value pairs from gdbm for which block evaluates to true are removed. See also: delete_if

member?

gdbm.has_key?(k) â true or falsegdbm.key?(k) â true or false Instance Public methods Returns true if the given key k exists within the database. Returns false otherwise.

length

gdbm.length â fixnum Instance Public methods Returns the number of key-value pairs in this database.