Prex v0.0.2 Prex.Templates View Source

Templates for equivalant code for api requests

Link to this section Summary

Functions

Generates elixir code for an action without any arguments

Creates an elixir module code for an API group

Link to this section Functions

Link to this function action_template(name, url, method, params, docs) View Source

Generates elixir code for an action without any arguments

Parameters:

  • name: Name of action
  • url: Url of action
  • method: Http method of action
  • params: List of action parameters
  • docs: Action documentation
Link to this function get_module(api_name, group_name, base_url, docs, actions) View Source

Creates an elixir module code for an API group

Parameters

  • api_name: The name of the api. Used to determine module name.
  • group_name: Name of api group
  • base_url: Base url of current group. e.g. “http://example.com”
  • docs: description of current module
  • actions: group actions