Class: FFI::CallbackInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi-compiler/fake_ffi/ffi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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 = options
end

Instance Attribute Details

#arg_typesObject (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

#optionsObject (readonly)

Returns the value of attribute options.



33
34
35
# File 'lib/ffi-compiler/fake_ffi/ffi.rb', line 33

def options
  @options
end

#return_typeObject (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