# `NebulaAPI.AST.Builder`
[🔗](https://github.com/podCloud/nebula_api/blob/v0.7.1/lib/nebula_api/ast/builder.ex#L1)

AST builder for NebulaAPI functions.

For each `defapi`, generates:
- `__nbapi_local_<name>` - Private function with the actual implementation —
  only on nodes where the method is local (no stub on the others: the router
  never references it there)
- `__nbapi_remote_<name>` - Private function that calls the remote method (every node)
- `<name>` - Public router function that delegates to local or remote based on context

# `build_local_function`

Builds the local implementation function.
Only generated when `is_local` is true — on remote nodes the router's default
branch goes remote (see `build_public_function/2`), nothing references a local
implementation, so none is emitted.

# `build_public_function`

Builds the public router function.
This function decides whether to call the local or remote implementation
based on the call context (unicast/multicast selector or default behavior).

# `build_remote_function`

Builds the remote call function.
This is always generated and calls the remote method via APIServer.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
