Class: GirFFI::Builders::ObjectBuilder

Inherits:
RegisteredTypeBuilder show all
Includes:
WithLayout, WithMethods
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

Instance Attribute Summary

Attributes inherited from GirFFI::BaseTypeBuilder

#info

Instance Method Summary collapse

Methods included from WithLayout

#layout_specification

Methods included from WithMethods

#setup_instance_method, #setup_method

Methods inherited from GirFFI::BaseTypeBuilder

#build_class, #initialize

Methods included from GirFFI::BuilderHelper

#const_defined_for, #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_property(property_name) ⇒ Object



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

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

#find_signal(signal_name) ⇒ Object



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

def find_signal signal_name
  signal_definers.each do |inf|
    sig = inf.find_signal signal_name
    return sig if sig
  end
  superclass.find_signal signal_name or
    raise "Signal #{signal_name} not found"
end

#object_class_structObject



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

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