ExUssd.Menu (ExUssd v0.1.1) View Source

Link to this section Summary

Functions

Render Function is used to create a ussd Menu.

Link to this section Functions

Render Function is used to create a ussd Menu.

## Params The function requires two keys as parameters :name - Name of the ussd component :handler - a callback handler that is invoked when then route is at that current position. The callback handler receives %ExUssd.Menu{} and the ussd api_parameters

Returns %ExUssd.Menu{} .

## Examples

  iex> ExUssd.Menu.render(
  ...>  name: "Home",
  ...>  handler: fn menu, _api_parameters ->
  ...>    menu |> Map.put(:title, "Home Page: Welcome")
  ...>  end
  ...> )
  %ExUssd.Menu{
    callback: #Function<1.49663807/1 in ExUssd.Menu.render/1>,
    error: nil,
    handle: false,
    handler: #Function<43.97283095/2 in :erl_eval.expr/5>,
    menu_list: [],
    name: "Home",
    next: "98",
    previous: "0",
    should_close: false,
    show_options: true,
    split: 7,
    success: false,
    title: nil
  }