Sha256: ff7bec868bb6a18a29f9b84c7a867ed66c5f554c6049c369deef4666a9ad6232

Contents?: true

Size: 705 Bytes

Versions: 9

Compression:

Stored size: 705 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_type
        Builder.build_class self
      end

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

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

GObjectIntrospection::IRegisteredTypeInfo.send :include,
                                               GirFFI::InfoExt::IRegisteredTypeInfo

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.11.0 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.10.2 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.10.1 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.10.0 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.10.0.pre1 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.9.5 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.9.4 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.9.3 lib/gir_ffi/info_ext/i_registered_type_info.rb