Class: FFI::Generator::Callback

Inherits:
Function show all
Defined in:
lib/generator/function.rb

Constant Summary

Constants inherited from Type

Type::ArrayRE, Type::ArraySizeRE

Instance Attribute Summary

Attributes inherited from Type

#full_decl

Attributes inherited from Node

#symname

Instance Method Summary collapse

Methods inherited from Node

#get_attr

Constructor Details

#initialize(params = { }) ⇒ Callback

Returns a new instance of Callback.



37
38
39
40
# File 'lib/generator/function.rb', line 37

def initialize(params = { })
  super(params)
  @inline = true if params[:inline] == true
end

Instance Method Details

#to_sObject



41
42
43
44
45
46
47
# File 'lib/generator/function.rb', line 41

def to_s
  unless @inline
    @indent_str + "callback(:#{@symname}, [ #{get_params.join(', ')} ], #{get_rtype})"
  else
    @indent_str + "callback([ #{get_params.join(', ')} ], #{get_rtype})"
  end
end