Class: GirFFI::Builders::CallbackBuilder
- Inherits:
-
GirFFI::BaseTypeBuilder
- Object
- GirFFI::BaseTypeBuilder
- GirFFI::Builders::CallbackBuilder
- Defined in:
- lib/gir_ffi/builders/callback_builder.rb
Overview
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.
Instance Attribute Summary
Attributes inherited from GirFFI::BaseTypeBuilder
Instance Method Summary collapse
- #argument_ffi_types ⇒ Object
- #mapping_method_definition ⇒ Object
- #return_ffi_type ⇒ Object
- #setup_class ⇒ Object
Methods inherited from GirFFI::BaseTypeBuilder
#build_class, #initialize, #instantiate_class
Methods included from GirFFI::BuilderHelper
#get_or_define_class, #get_or_define_module, #optionally_define_constant
Constructor Details
This class inherits a constructor from GirFFI::BaseTypeBuilder
Instance Method Details
#argument_ffi_types ⇒ Object
23 24 25 |
# File 'lib/gir_ffi/builders/callback_builder.rb', line 23 def argument_ffi_types @argument_ffi_types ||= @info.argument_ffi_types end |
#mapping_method_definition ⇒ Object
19 20 21 |
# File 'lib/gir_ffi/builders/callback_builder.rb', line 19 def mapping_method_definition MappingMethodBuilder.for_callback(info).method_definition end |
#return_ffi_type ⇒ Object
27 28 29 |
# File 'lib/gir_ffi/builders/callback_builder.rb', line 27 def return_ffi_type @return_ffi_type ||= @info.return_ffi_type end |
#setup_class ⇒ Object
13 14 15 16 17 |
# File 'lib/gir_ffi/builders/callback_builder.rb', line 13 def setup_class setup_callback setup_constants klass.class_eval mapping_method_definition, __FILE__, __LINE__ end |