fetch( key, ifnone = nil )fetch( key, &block ) Instance Public methods Return value associated with key. If there is no value for key and no block is given, returns ifnone. Otherwise, calls block passing in the given key.
has_value?( val ) Instance Public methods Returns true if specified value is found in the database.
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.
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.
key( keystr ) Instance Public methods
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.
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.
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
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.
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
Page 1920 of 11844