class

PointClickEngine::Scripting::ScriptAPIRegistry

Inherits Reference < Object

Manages registration of Crystal functions into Lua

Constructors

Instance methods

add_module_function(module_name : String, function_name : String, lua_code : String)

Add a function to a module

Source
clear_registrations

Clear all registrations (note: doesn't unregister from Lua)

Source
create_module(module_name : String)

Create a Lua table/module

Source
create_wrapper(lua_function : String, crystal_function : String, *args)

Create a Lua wrapper function that calls a Crystal function

Source
function_registered?(name : String) : Bool

Check if a function is registered

Source
register_function(lua_name : String, &block : Luajit::LuaState -> Int32)

Register a Crystal function to be callable from Lua

Source
register_value_function(lua_name : String, return_count : Int32, &block : Luajit::LuaState -> Nil)

Register a callback that returns values

Source
register_void_function(lua_name : String, &block : Luajit::LuaState -> Nil)

Register a void callback (no return values)

Source
registered_functions

Get list of all registered functions

Source