Class: GirFFI::Builders::CallbackArgumentBuilder
Constant Summary
BaseArgumentBuilder::KEYWORDS
Instance Attribute Summary
#arginfo, #array_arg, #is_closure, #length_arg
Instance Method Summary
collapse
#argument_class_name, #array_length_idx, #callarg, #direction, #initialize, #name, #new_variable, #safe, #specialized_type_tag, #type_info
Instance Method Details
#call_argument_name ⇒ Object
17
18
19
20
21
|
# File 'lib/gir_ffi/builders/callback_argument_builder.rb', line 17
def call_argument_name
if direction == :in
pre_converted_name unless array_arg
end
end
|
#capture_variable_name ⇒ Object
23
24
25
26
27
|
# File 'lib/gir_ffi/builders/callback_argument_builder.rb', line 23
def capture_variable_name
if direction == :out
@capture_variable_name ||= new_variable
end
end
|
#method_argument_name ⇒ Object
9
10
11
|
# File 'lib/gir_ffi/builders/callback_argument_builder.rb', line 9
def method_argument_name
@method_argument_name ||= name || new_variable
end
|
#post_conversion ⇒ Object
38
39
40
41
42
43
44
|
# File 'lib/gir_ffi/builders/callback_argument_builder.rb', line 38
def post_conversion
if direction == :out
[ "#{pre_converted_name}.set_value #{capture_variable_name}" ]
else
[]
end
end
|
#pre_conversion ⇒ Object
29
30
31
32
33
34
35
36
|
# File 'lib/gir_ffi/builders/callback_argument_builder.rb', line 29
def pre_conversion
case direction
when :in
[ "#{pre_converted_name} = #{pre_convertor.conversion}" ]
when :out
[ "#{pre_converted_name} = #{out_parameter_preparation}" ]
end
end
|
#pre_converted_name ⇒ Object
13
14
15
|
# File 'lib/gir_ffi/builders/callback_argument_builder.rb', line 13
def pre_converted_name
@pre_converted_name ||= new_variable
end
|