View Source Flamel.Map.Indifferent (flamel v1.4.0)
Summary
Functions
Get a value from a map whether the key is a string or atom
Functions
Get a value from a map whether the key is a string or atom
Examples
iex> Flamel.Map.Indifferent.get(%{test: "value"}, "test")
"value"
iex> Flamel.Map.Indifferent.get(%{test: "value"}, :test)
"value"
iex> Flamel.Map.Indifferent.get(%{"test" => "value"}, :test)
"value"
iex> Flamel.Map.Indifferent.get(%{"test" => "value"}, "test")
"value"
iex> Flamel.Map.Indifferent.get(%{"test" => "value"}, "does-not-exist", "default")
"default"