Class: GirFFI::Builders::RegisteredTypeBuilder

Inherits:
GirFFI::BaseTypeBuilder show all
Defined in:
lib/gir_ffi/builders/registered_type_builder.rb

Overview

Base class for type builders building types specified by subtypes of IRegisteredTypeInfo. These are types whose C representation is complex, i.e., a struct or a union.

Instance Attribute Summary

Attributes inherited from GirFFI::BaseTypeBuilder

#info

Instance Method Summary collapse

Methods inherited from GirFFI::BaseTypeBuilder

#build_class, #initialize, #instantiate_class

Methods included from GirFFI::BuilderHelper

#get_or_define_class, #get_or_define_module, #optionally_define_constant

Constructor Details

This class inherits a constructor from GirFFI::BaseTypeBuilder

Instance Method Details

#setup_instance_method(method) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/gir_ffi/builders/registered_type_builder.rb', line 23

def setup_instance_method(method)
  method_info = info.find_instance_method method
  return unless method_info

  remove_old_method method_info, build_class
  attach_and_define_method method_info
end

#setup_method(method) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/gir_ffi/builders/registered_type_builder.rb', line 15

def setup_method(method)
  method_info = info.find_method method
  return unless method_info

  remove_old_method method_info, meta_class
  attach_and_define_method method_info
end

#target_gtypeObject



31
32
33
# File 'lib/gir_ffi/builders/registered_type_builder.rb', line 31

def target_gtype
  info.g_type
end