Class: GirFFI::Builders::ObjectBuilder
- Inherits:
-
RegisteredTypeBuilder
- Object
- GirFFI::BaseTypeBuilder
- RegisteredTypeBuilder
- GirFFI::Builders::ObjectBuilder
- 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
Defined Under Namespace
Classes: ObjectBaseBuilder
Instance Attribute Summary
Attributes inherited from GirFFI::BaseTypeBuilder
Instance Method Summary collapse
- #ancestor_infos ⇒ Object
- #class_struct_class ⇒ Object
- #eligible_properties ⇒ Object
- #find_property(property_name) ⇒ Object
- #find_signal(signal_name) ⇒ Object
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
#ancestor_infos ⇒ Object
51 52 53 |
# File 'lib/gir_ffi/builders/object_builder.rb', line 51 def ancestor_infos @ancestor_infos ||= [info] + info.interfaces + parent_ancestor_infos end |
#class_struct_class ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/gir_ffi/builders/object_builder.rb', line 38 def class_struct_class @class_struct_class ||= begin parent_struct = parent_builder.class_struct_class if class_struct_info StructBuilder.new(class_struct_info, superclass: parent_struct).build_class else parent_struct end end end |
#eligible_properties ⇒ Object
55 56 57 58 59 |
# File 'lib/gir_ffi/builders/object_builder.rb', line 55 def eligible_properties info.properties.reject do |pinfo| info.find_instance_method("get_#{pinfo.name}") end end |
#find_property(property_name) ⇒ Object
34 35 36 |
# File 'lib/gir_ffi/builders/object_builder.rb', line 34 def find_property(property_name) seek_in_ancestor_infos { |info| info.find_property property_name } end |
#find_signal(signal_name) ⇒ Object
30 31 32 |
# File 'lib/gir_ffi/builders/object_builder.rb', line 30 def find_signal(signal_name) seek_in_ancestor_infos { |info| info.find_signal signal_name } end |