class GirFFI::BoxedBase
Base class for generated classes representing boxed types.
Public Class Methods
Source
# File lib/gir_ffi/boxed_base.rb, line 12 def self.copy(val) ptr = GObject.boxed_copy(gtype, val) wrap(ptr) end
Source
# File lib/gir_ffi/boxed_base.rb, line 8 def self.make_finalizer(struct) proc { finalize(struct) } end
Protected Class Methods
Source
# File lib/gir_ffi/boxed_base.rb, line 20 def finalize(struct) struct.owned? or return struct.owned = nil GObject.boxed_free gtype, struct.to_ptr end
Private Instance Methods
Source
# File lib/gir_ffi/boxed_base.rb, line 35 def make_finalizer ObjectSpace.define_finalizer self, self.class.make_finalizer(struct) end
Source
# File lib/gir_ffi/boxed_base.rb, line 30 def store_pointer(*) super make_finalizer end
Calls superclass method