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

Additional helper functions for working with maps

Link to this section 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.

Link to this section Types

Link to this section Functions

Specs

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

Specs

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.