ExUtils v0.1.2 ExUtils
Collection of core Elixir utility methods that don’t fit in any specific Module
Summary
Functions
Checks if a Module exports a specific method
Checks if the term is a pure map (i.e. not a struct)
Checks if the term is a struct as well as a map
Functions
has_method?(module, method)
has_method?(module :: module, method :: atom | tuple :: {atom, number}) :: boolean
Checks if a Module exports a specific method
First argument must be a Module and the second argument can
either be an :atom
name of the function or a {:atom, arity}
tuple
Example
ExUtils.has_method?(Map, :keys) # => true
ExUtils.has_method?(Map, {:keys, 1}) # => true
ExUtils.has_method?(Map, {:keys, 2}) # => false