fetch( keystr, ifnone = nil )
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.
# File lib/yaml/dbm.rb, line 56 def fetch( keystr, ifnone = nil ) begin val = super( keystr ) return YAML.load( val ) if String === val rescue IndexError end if block_given? yield keystr else ifnone end end