Sha256: 1c703aa8f87eb6d1de05d0c015866014387781f5ce225f43d08635e58ea83a85

Contents?: true

Size: 493 Bytes

Versions: 1

Compression:

Stored size: 493 Bytes

Contents

module GirFFI
  module Builders
    # Builder that generates code to convert closure arguments ('user data')
    # from Ruby to C. Used by argument builders.
    class ClosureToPointerConvertor
      def initialize(argument_name, callback_argument)
        @argument_name = argument_name
        @callback_argument = callback_argument
      end

      def conversion
        "GirFFI::InPointer.from_closure_data(#{@callback_argument.call_argument_name}.object_id)"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gir_ffi-0.9.0 lib/gir_ffi/builders/closure_to_pointer_convertor.rb