class Lua::Function
- Lua::Function
- Lua::Object
- Reference
- Object
Defined in:
lua/object/function.crInstance Method Summary
-
#call(*args)
Make a call to the Lua function.
-
#to_s(io)
String representation of the function.
Instance methods inherited from class Lua::Object
ref : Int32?
ref,
release(stack = @stack)
release
Constructor methods inherited from class Lua::Object
new(stack : Stack, ref : Int32 | Nil)
new
Instance Method Detail
def call(*args)
#
Make a call to the Lua function.
s = Lua::Stack.new
sum = s.run(%q{
function sum(x, y)
return x + y
end
return sum
}).as(Lua::Function)
sum.call(2, 3) # => 5.0
def to_s(io)
#
String representation of the function. Contains number of args and function Lua source.