Extra v0.2.0 Map.Extra
Extensions to the built-in Map module.
Link to this section Summary
Functions
Raises an ArgumentError error if map does not have the provided key
Raises an ArgumentError if map does not have all of the provided keys
Returns true if the map has all of the keys
Takes the fields specified by keys from map if their values are present and non nil
Link to this section Functions
Link to this function
assert_key!(map, key, opts \\ [])
assert_key!(map, atom, keyword) :: :ok | no_return
Raises an ArgumentError error if map does not have the provided key.
Options
:message:binary, the message to raise with when the value is missing.:allow_nil_value:boolean, Default:true. Set to true if anilvalue should not raise.
Link to this function
assert_keys!(map, keys, opts \\ [])
assert_keys!(map, [key :: any], keyword) :: :ok | no_return
Raises an ArgumentError if map does not have all of the provided keys.
Options
:message:binary, the message to raise with when the value is missing.:allow_nil_value:boolean, Default:true. Set to true if anilvalue should not raise.
Returns true if the map has all of the keys.