Class: GirFFI::Builders::StructBuilder
- Inherits:
-
RegisteredTypeBuilder
- Object
- GirFFI::BaseTypeBuilder
- RegisteredTypeBuilder
- GirFFI::Builders::StructBuilder
- Includes:
- StructLike
- Defined in:
- lib/gir_ffi/builders/struct_builder.rb
Overview
Implements the creation of a class representing a Struct.
Instance Attribute Summary
Attributes inherited from GirFFI::BaseTypeBuilder
Instance Method Summary collapse
Methods included from StructLike
#setup_class, #setup_field_accessors
Methods included from WithLayout
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
#layout_superclass ⇒ Object
13 14 15 |
# File 'lib/gir_ffi/builders/struct_builder.rb', line 13 def layout_superclass GirFFI::Struct end |
#parent_field_type ⇒ Object
26 27 28 |
# File 'lib/gir_ffi/builders/struct_builder.rb', line 26 def parent_field_type fields.first.field_type end |
#superclass ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/gir_ffi/builders/struct_builder.rb', line 17 def superclass # HACK: Inheritance chain is not expressed in GObject's code correctly. return GObject::ObjectClass if info.full_type_name == 'GObject::InitiallyUnownedClass' return parent_field_type.tag_or_class if info.gtype_struct? return BoxedBase if GObject.type_fundamental(info.gtype) == GObject::TYPE_BOXED StructBase end |