Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

YAML::DBM#fetch

ydbm.fetch( key, ifnone = nil )
ydbm.fetch( key ) { |key| ... }

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.

See ::DBM#fetch for more information.

See also #each_value #has_value? #each_pair #index also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0