Sha256: 371de4eae15a2f6d5c6a95c667a69073e1cc25d9049c93049788a8b315a0ebf1

Contents?: true

Size: 904 Bytes

Versions: 6

Compression:

Stored size: 904 Bytes

Contents

module GirFFI
  # Represents a type not found in the GIR, conforming, as needed, to the
  # interface of GObjectIntrospection::IObjectInfo.
  class UnintrospectableTypeInfo
    attr_reader :g_type

    def initialize(gtype,
                   gir = GObjectIntrospection::IRepository.default,
                   gobject = ::GObject)
      @g_type = gtype
      @gir = gir
      @gobject = gobject
    end

    def info_type
      :unintrospectable
    end

    def safe_name
      @gobject.type_name @g_type
    end

    def parent
      parent_gtype = @gobject.type_parent(@g_type)
      @gir.find_by_gtype(parent_gtype) || self.class.new(parent_gtype, @gir, @gobject)
    end

    def namespace
      parent.namespace
    end

    def interfaces
      @gobject.type_interfaces(@g_type).map do |gtype|
        @gir.find_by_gtype gtype
      end.compact
    end

    def fields
      []
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gir_ffi-0.6.7 lib/gir_ffi/unintrospectable_type_info.rb
gir_ffi-0.6.6 lib/gir_ffi/unintrospectable_type_info.rb
gir_ffi-0.6.5 lib/gir_ffi/unintrospectable_type_info.rb
gir_ffi-0.6.4 lib/gir_ffi/unintrospectable_type_info.rb
gir_ffi-0.6.3 lib/gir_ffi/unintrospectable_type_info.rb
gir_ffi-0.6.2 lib/gir_ffi/unintrospectable_type_info.rb