Pokerap v0.0.9 Pokerap.Macro
Collection of macros
Summary
Macros
Creates a series of functions to be able to retrieve data from API endpoints
Macros
Creates a series of functions to be able to retrieve data from API endpoints
Just about all of the functions in the top-level Pokerap
module are created via this macro
Iterates over a list, such a [:pokemon, :types, “berries”] (atoms or strings, whatever is a better fit for the situation) and each item is formatted to a proper method name, and then the method is defined via macro.
Each method takes “value” as an argument. This can be a string, int, or atom (see Pokerap.Url.get_endpoint).
! methods are also defined for each item in list.