Class: GirFFI::Builders::UnintrospectableBuilder

Inherits:
ObjectBuilder show all
Defined in:
lib/gir_ffi/builders/unintrospectable_builder.rb

Overview

Implements the creation of a class representing an object type for which no data is found in the GIR. Typically, these are created to cast objects returned by a function that returns an interface.

Instance Attribute Summary

Attributes inherited from GirFFI::BaseTypeBuilder

#info

Instance Method Summary collapse

Methods inherited from ObjectBuilder

#ancestor_infos, #class_struct_class, #eligible_properties, #find_property

Methods included from WithLayout

#layout_specification

Methods inherited from RegisteredTypeBuilder

#setup_method, #target_gtype

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

#find_signal(signal_name) ⇒ Object



26
27
28
29
30
31
32
33
34
# File 'lib/gir_ffi/builders/unintrospectable_builder.rb', line 26

def find_signal(signal_name)
  info = super
  return info if info

  signal_id = GObject.signal_lookup signal_name, target_gtype
  return if signal_id == 0

  UnintrospectableSignalInfo.new(signal_id)
end

#klassObject



12
13
14
# File 'lib/gir_ffi/builders/unintrospectable_builder.rb', line 12

def klass
  @klass ||= TypeBuilder::CACHE[target_gtype] ||= Class.new(superclass)
end

#setup_classObject



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

def setup_class
  setup_constants
  setup_layout
  setup_interfaces
end

#setup_instance_method(_method) ⇒ Object



22
23
24
# File 'lib/gir_ffi/builders/unintrospectable_builder.rb', line 22

def setup_instance_method(_method)
  false
end