instance method
YAML::DBM#shift
ydbm.shift → [key, value]
lib/yaml/dbm.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/yaml/dbm.rb, line 218
def shift
a = super
if a
a[1] = YAML.respond_to?(:safe_load) ? YAML.safe_load( a[1] ) : YAML.load( a[1] )
end
a
end
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.