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.
# File lib/gir_ffi/builders/callback_builder.rb, line 29 def argument_types @info.argument_ffi_types end
# File lib/gir_ffi/builders/callback_builder.rb, line 25 def callback_sym @classname.to_sym end
# File lib/gir_ffi/builders/callback_builder.rb, line 11 def instantiate_class @klass ||= optionally_define_constant namespace_module, @classname do cb = lib.callback callback_sym, argument_types, return_type cb.instance_eval mapping_method_definition cb.extend CallbackBase cb end @klass end
# File lib/gir_ffi/builders/callback_builder.rb, line 21 def mapping_method_definition MappingMethodBuilder.new(info.args, info.return_type).method_definition end
# File lib/gir_ffi/builders/callback_builder.rb, line 33 def return_type @info.return_ffi_type end