Sha256: 6684851117a5d45d23b7448c2252adb986a9210730d6e164981986dacb0ab976

Contents?: true

Size: 724 Bytes

Versions: 11

Compression:

Stored size: 724 Bytes

Contents

# frozen_string_literal: true

require "gir_ffi/builder_helper"

module GirFFI
  module InfoExt
    # Extensions for GObjectIntrospection::IRegisteredTypeInfo needed by GirFFI
    module IRegisteredTypeInfo
      def to_ffi_type
        to_type.to_ffi_type
      end

      def to_callback_ffi_type
        to_type.to_callback_ffi_type
      end

      def to_type
        Builder.build_class self
      end

      def find_instance_method(method)
        info = find_method method
        return info if info&.method?
      end

      def find_method(_method)
        raise "Must be overridden in subclass"
      end
    end
  end
end

GObjectIntrospection::IRegisteredTypeInfo.include GirFFI::InfoExt::IRegisteredTypeInfo

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gir_ffi-0.16.0 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.9 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.8 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.7 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.6 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.5 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.4 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.3 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.2 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.1 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.15.0 lib/gir_ffi/info_ext/i_registered_type_info.rb