Class: GirFFI::Builder::Type::Callback
- Inherits:
-
Base
- Object
- Base
- GirFFI::Builder::Type::Callback
show all
- Defined in:
- lib/gir_ffi/builder/type/callback.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 Base
#info
Instance Method Summary
collapse
Methods inherited from Base
#build_class, #initialize
#const_defined_for, #optionally_define_constant
Instance Method Details
#argument_types ⇒ Object
20
21
22
|
# File 'lib/gir_ffi/builder/type/callback.rb', line 20
def argument_types
@info.argument_ffi_types
end
|
#callback_sym ⇒ Object
16
17
18
|
# File 'lib/gir_ffi/builder/type/callback.rb', line 16
def callback_sym
@classname.to_sym
end
|
#instantiate_class ⇒ Object
10
11
12
13
14
|
# File 'lib/gir_ffi/builder/type/callback.rb', line 10
def instantiate_class
@klass = optionally_define_constant namespace_module, @classname do
lib.callback callback_sym, argument_types, return_type
end
end
|
#return_type ⇒ Object
24
25
26
|
# File 'lib/gir_ffi/builder/type/callback.rb', line 24
def return_type
@info.return_ffi_type
end
|