Lunar.Library behaviour (Lunar v1.0.2)
Defines a library that will extend the Lua runtime.
## Example usage
defmodule MyLibrary do
use Lunar.Library, scope: "my_library"
deflua hello(name) do
"Hello, #{name}!"
end
end
In our Lua code, we can now call my_library.hello("Robert")
and get back "Hello, Robert!"
.
Summary
Types
@type t() :: Lunar.Library
Callbacks
Link to this callback
install(tuple)
Link to this callback
scope()
@callback scope() :: String.t()
Link to this callback
table()
@callback table() :: [tuple()]