Skip to content

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

instance method

YAML::DBM#shift

ydbm.shift → [key, value]

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.

See also #select #store #replace #to_a also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1