Access.get
You're seeing just the function
get
, go back to Access module for more information.
Specs
get(container(), term(), term()) :: term()
get(nil_container(), any(), default) :: default when default: var
Gets the value for the given key in a container (a map, keyword
list, or struct that implements the Access
behaviour).
Returns the value under key
if there is such a key, or default
if key
is
not found.
Examples
iex> Access.get(%{name: "john"}, :name, "default name")
"john"
iex> Access.get(%{name: "john"}, :age, 25)
25
iex> Access.get([ordered: true], :timeout)
nil