View Source ExTwilio.Ext.Map (ExTwilio v0.10.0)

Additional helper functions for working with maps.

Summary

Functions

Puts a given key/value pair into a map, if the value is not false or nil.

Validates that a function returns true on the given map field, otherwise raises an error.

Types

Functions

@spec put_if(map(), key(), any()) :: map()

Puts a given key/value pair into a map, if the value is not false or nil.

Link to this function

validate!(map, field, fun, message)

View Source
@spec validate!(map(), key(), function(), message :: String.t()) ::
  map() | no_return()

Validates that a function returns true on the given map field, otherwise raises an error.