Sha256: 2bfdb16a26524a1e4117ce5abbe65cffc4525f6c0deda4555dccd875b89e4cc9

Contents?: true

Size: 706 Bytes

Versions: 5

Compression:

Stored size: 706 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

5 entries across 5 versions & 1 rubygems

Version Path
gir_ffi-0.13.0 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.12.1 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.11.4 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.11.3 lib/gir_ffi/info_ext/i_registered_type_info.rb
gir_ffi-0.11.2 lib/gir_ffi/info_ext/i_registered_type_info.rb