Class: FFI::CallbackInfo
- Inherits:
-
Object
- Object
- FFI::CallbackInfo
- Defined in:
- lib/ffi-compiler/fake_ffi/ffi.rb
Instance Attribute Summary collapse
-
#arg_types ⇒ Object
readonly
Returns the value of attribute arg_types.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#return_type ⇒ Object
readonly
Returns the value of attribute return_type.
Instance Method Summary collapse
-
#initialize(return_type, arg_types = [], *other) ⇒ CallbackInfo
constructor
A new instance of CallbackInfo.
- #name(name) ⇒ Object
Constructor Details
#initialize(return_type, arg_types = [], *other) ⇒ CallbackInfo
Returns a new instance of CallbackInfo.
35 36 37 38 39 |
# File 'lib/ffi-compiler/fake_ffi/ffi.rb', line 35 def initialize(return_type, arg_types = [], *other) @return_type = return_type @arg_types = arg_types @options = end |
Instance Attribute Details
#arg_types ⇒ Object (readonly)
Returns the value of attribute arg_types.
32 33 34 |
# File 'lib/ffi-compiler/fake_ffi/ffi.rb', line 32 def arg_types @arg_types end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
33 34 35 |
# File 'lib/ffi-compiler/fake_ffi/ffi.rb', line 33 def @options end |
#return_type ⇒ Object (readonly)
Returns the value of attribute return_type.
31 32 33 |
# File 'lib/ffi-compiler/fake_ffi/ffi.rb', line 31 def return_type @return_type end |
Instance Method Details
#name(name) ⇒ Object
41 42 43 44 |
# File 'lib/ffi-compiler/fake_ffi/ffi.rb', line 41 def name(name) params = @arg_types.empty? ? 'void' : @arg_types.map(&:name).join(', ') "#{@return_type.name} (*#{name})(#{params})" end |