Class: GirFFI::Builders::ObjectBuilder

Inherits:
RegisteredTypeBuilder show all
Includes:
WithLayout
Defined in:
lib/gir_ffi/builders/object_builder.rb

Overview

Implements the creation of a class representing a GObject Object.

Direct Known Subclasses

UnintrospectableBuilder, UserDefinedBuilder

Defined Under Namespace

Classes: ObjectBaseBuilder

Instance Attribute Summary

Attributes inherited from GirFFI::BaseTypeBuilder

#info

Instance Method Summary collapse

Methods included from WithLayout

#layout_specification

Methods inherited from RegisteredTypeBuilder

#setup_instance_method, #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

#ancestor_infosObject



37
38
39
# File 'lib/gir_ffi/builders/object_builder.rb', line 37

def ancestor_infos
  @ancestor_infos ||= [info] + info.interfaces + parent_ancestor_infos
end

#find_property(property_name) ⇒ Object



28
29
30
31
# File 'lib/gir_ffi/builders/object_builder.rb', line 28

def find_property property_name
  seek_in_ancestor_infos { |info| info.find_property property_name } or
    raise "Property #{property_name} not found"
end

#find_signal(signal_name) ⇒ Object



23
24
25
26
# File 'lib/gir_ffi/builders/object_builder.rb', line 23

def find_signal signal_name
  seek_in_ancestor_infos { |info| info.find_signal signal_name } or
    raise "Signal #{signal_name} not found"
end

#object_class_structObject



33
34
35
# File 'lib/gir_ffi/builders/object_builder.rb', line 33

def object_class_struct
  @object_class_struct ||= Builder.build_class object_class_struct_info
end