class Concurrent::Map
def fetch_or_store(key, default_value = NULL)
Experimental RBS support (using type sampling data from the type_fusion project).
def fetch_or_store: (String key, ?Object default_value) -> (Array[String] | Sprockets::Asset | File::Stat)
This signature was generated using 3 samples from 1 application.
-
(Object)- the value or default value
Other tags:
- Yieldreturn: - default value
Other tags:
- Yieldparam: key -
Other tags:
- Yield: - default value for a key
Parameters:
-
default_value(Object) -- -
key(Object) --
def fetch_or_store(key, default_value = NULL) fetch(key) do put(key, block_given? ? yield(key) : (NULL == default_value ? raise_fetch_no_key : default_value)) end end