module Lua::StackMixin::Chunk
Direct including types
Defined in:
lua/stack/chunk.crInstance Method Summary
-
#run(buff : String, name : String | Nil = nil)
Evaluates a Lua chunk and returns the result if any.
-
#run(lua_file : File)
Evaluates a Lua chunk in a file and returns the result if any.
Instance Method Detail
def run(buff : String, name : String | Nil = nil)
#
Evaluates a Lua chunk and returns the result if any.
You can set the name of your chunk using name
var.
Stack.new.run %q{
double = function (x)
return x * 2
end
return double(double(2))
} # => 8
def run(lua_file : File)
#
Evaluates a Lua chunk in a file and returns the result if any.
Stack.new.run File.new("./sample.lua")