Class: Rufus::Lua::Ref
Included Modules
The parent class for Table, Function and Coroutine. Simply holds a reference to the object in the Lua registry.
Attributes
Instance Attributes
| ref | [R] | public |
The reference in the Lua registry. |
|---|
Constants Included from Rufus::Lua::StateMixin
LUA_ENVIRONINDEX, LUA_GCCOLLECT, LUA_GCCOUNT, LUA_GCCOUNTB, LUA_GCRESTART, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, LUA_GCSTEP, LUA_GCSTOP, LUA_GLOBALSINDEX, LUA_MULTRET, LUA_NOREF, LUA_REFNIL, LUA_REGISTRYINDEX, SIMPLE_TYPES, TBOOLEAN, TFUNCTION, TLIGHTUSERDATA, TNIL, TNONE, TNUMBER, TSTRING, TTABLE, TTHREAD, TUSERDATA
Constructor Summary
public
initialize(pointer)
[View source]
40 41 42 43 44 45 |
# File 'lib/rufus/lua/objects.rb', line 40 def initialize (pointer) @pointer = pointer @ref = Lib.luaL_ref(@pointer, LUA_REGISTRYINDEX) # this pops the object out of the stack ! end |
Public Visibility
Public Instance Method Summary
| #free |
Frees the reference to this object (Problably a good idea if you want Lua’s GC to get rid of it later). |
|---|
Public Instance Method Details
free
public
free
Frees the reference to this object (Problably a good idea if you want Lua’s GC to get rid of it later).
[View source]
50 51 52 53 54 |
# File 'lib/rufus/lua/objects.rb', line 50 def free Lib.luaL_unref(@pointer, LUA_REGISTRYINDEX, @ref) @ref = nil end |