Sha256: 0a35c260d3461bcdbdd0ee2d6ea3e9dbd172dcd35157dbf7329c247e49b11093

Contents?: true

Size: 618 Bytes

Versions: 5

Compression:

Stored size: 618 Bytes

Contents

require 'gir_ffi/builder/type/base'
module GirFFI
  module Builder
    module Type

      # Implements the creation of a callback type. The type will be
      # attached to the appropriate namespace module, and will be defined
      # as a callback for FFI.
      class Callback < Base
        def instantiate_class
          @klass = optionally_define_constant namespace_module, @classname do
            args = Builder.ffi_function_argument_types info
            ret = Builder.ffi_function_return_type info
            lib.callback @classname.to_sym, args, ret
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gir_ffi-0.1.0 lib/gir_ffi/builder/type/callback.rb
gir_ffi-0.0.14 lib/gir_ffi/builder/type/callback.rb
gir_ffi-0.0.13 lib/gir_ffi/builder/type/callback.rb
gir_ffi-0.0.12 lib/gir_ffi/builder/type/callback.rb
gir_ffi-0.0.11 lib/gir_ffi/builder/type/callback.rb