Sha256: 90bc010c778b1730252f9c4e7dac583728415e060ed109c2f4fd713a2d648eb1
Contents?: true
Size: 626 Bytes
Versions: 13
Compression:
Stored size: 626 Bytes
Contents
# frozen_string_literal: true module Libvirt module FFI module Helpers # Creates function by provided callback or callback name # @param callback [Symbol,FFI::CallbackInfo] callback name registered in current module # @param args [Array] extra arguments for FFI::Function # @yield when function is called # @return [FFI::Function] def callback_function(callback, *args, &block) callback_info = callback.is_a?(Symbol) ? find_type(callback) : callback ::FFI::Function.new(callback_info.result_type, callback_info.param_types, *args, &block) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems