Sha256: fffb88a8bd7748b03825ecc5ca68d6a86671a82b2665d55674b0f3831f96159c

Contents?: true

Size: 591 Bytes

Versions: 6

Compression:

Stored size: 591 Bytes

Contents

# frozen_string_literal: true
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::ArgHelper.store(#{callback_argument_name})"
      end

      private

      def callback_argument_name
        @callback_argument.call_argument_name
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gir_ffi-0.11.1 lib/gir_ffi/builders/closure_to_pointer_convertor.rb
gir_ffi-0.11.0 lib/gir_ffi/builders/closure_to_pointer_convertor.rb
gir_ffi-0.10.2 lib/gir_ffi/builders/closure_to_pointer_convertor.rb
gir_ffi-0.10.1 lib/gir_ffi/builders/closure_to_pointer_convertor.rb
gir_ffi-0.10.0 lib/gir_ffi/builders/closure_to_pointer_convertor.rb
gir_ffi-0.10.0.pre1 lib/gir_ffi/builders/closure_to_pointer_convertor.rb