ExUssd.Nav (ExUssd v1.0.0-rc-1) View Source
USSD Nav module
Link to this section Summary
Link to this section Types
Link to this section Functions
Specs
new(keyword()) :: %ExUssd.Nav{ bottom: term(), delimiter: term(), left: term(), match: term(), name: term(), orientation: term(), reverse: term(), right: term(), show: term(), top: term(), type: term() }
Its used to create a new ExUssd Nav menu.
Parameters
opts- Nav arguments
Example
iex> ExUssd.new(name: "home") |> ExUssd.set(nav: Nav.new(type: :next, name: "MORE", match: "98"))
iex> ExUssd.new(name: "home")
|> ExUssd.set(nav: [
ExUssd.Nav.new(type: :home, name: "HOME", match: "00", reverse: true, orientation: :vertical)
ExUssd.Nav.new(type: :back, name: "BACK", match: "0", right: 1),
ExUssd.Nav.new(type: :next, name: "MORE", match: "98")
])
Specs
Convert the USSD navigation menu to string
## Parameters
nav- Nav Structdepth- depth of the nav menumax- max value of the menu list
Example
iex> Nav.new(type: :next, name: "MORE", match: "98") |> Nav.to_string()
"MORE:98"
iex> nav = [
ExUssd.Nav.new(type: :home, name: "HOME", match: "00", reverse: true, orientation: :vertical),
ExUssd.Nav.new(type: :back, name: "BACK", match: "0", right: 1),
ExUssd.Nav.new(type: :next, name: "MORE", match: "98")
]
iex> ExUssd.Nav.to_string(nav)
"HOME:00
BACK:0 MORE:98"