Class: Rufus::Lua::Ref

Included Modules

Rufus::Lua::StateMixin

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.

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
Generated on Wednesday, September 30 2009 at 01:27:08 PM by YARD 0.2.3.5 (ruby-1.8.7).