Actions
Feature #14128
openIntroduce Hash#delete default value
Feature #14128:
Introduce Hash#delete default value
Description
Mirror Hash#fetch(key [, default]) → obj
with Hash#delete(key [, default]) → obj
.
Allows for more concise extraction of a value from a hash with a default.
# Currently
a = hash.delete(:a) { 10 }
# Becomes
a = hash.delete(:a, 10)
Actions