to_hash

to_hash() Instance Public methods Converts the contents of the database to an in-memory Hash object, and returns it.

to_a

to_a() Instance Public methods Converts the contents of the database to an array of [key, value] arrays, and returns it.

store

store( key, value ) Instance Public methods Stores value in database with key as the index. value is converted to YAML before being stored. Returns value

shift

shift() Instance Public methods Removes a [key, value] pair from the database, and returns it. If the database is empty, returns nil. The order in which values are removed/returned is not guaranteed.

select

select( &block )select( *keys ) Instance Public methods If a block is provided, returns a new array containing [key, value] pairs for which the block returns true. Otherwise, same as values_at

replace

replace( hsh ) Instance Public methods Replaces the contents of the database with the contents of the specified object. Takes any object which implements the #each_pair method, including Hash and DBM objects.

reject

reject() Instance Public methods Converts the contents of the database to an in-memory Hash, then calls Hash#reject with the specified code block, returning a new Hash.

key

key( keystr ) Instance Public methods

invert

invert() Instance Public methods Returns a Hash (not a DBM database) created by using each value in the database as a key, with the corresponding key as its value. Note that all values in the hash will be Strings, but the keys will be actual objects.

index

index( keystr ) Instance Public methods Deprecated, used #key instead. Note: #index makes warning from internal of ::DBM#index. It says 'DBM#index is deprecated; use #key', but #key behaves not same as #index.