Class: GirFFI::Builders::ReturnValueBuilder
Overview
Implements building post-processing statements for return values.
Constant Summary
BaseArgumentBuilder::KEYWORDS
Instance Attribute Summary
#arginfo, #array_arg, #length_arg
Instance Method Summary
collapse
#argument_class_name, #array_length_idx, #call_argument_name, #closure=, #closure?, #direction, #name, #new_variable, #safe, #specialized_type_tag, #type_info
Constructor Details
#initialize(var_gen, arginfo, constructor_result = false) ⇒ ReturnValueBuilder
Returns a new instance of ReturnValueBuilder.
10
11
12
13
|
# File 'lib/gir_ffi/builders/return_value_builder.rb', line 10
def initialize var_gen, arginfo, constructor_result = false
super var_gen, arginfo
@constructor_result = constructor_result
end
|
Instance Method Details
#capture_variable_name ⇒ Object
19
20
21
|
# File 'lib/gir_ffi/builders/return_value_builder.rb', line 19
def capture_variable_name
@capture_variable_name ||= new_variable if relevant?
end
|
#post_conversion ⇒ Object
35
36
37
38
39
40
41
42
|
# File 'lib/gir_ffi/builders/return_value_builder.rb', line 35
def post_conversion
if has_post_conversion?
["#{post_converted_name} = #{post_convertor.conversion}"]
else
[]
end
end
|
#post_converted_name ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/gir_ffi/builders/return_value_builder.rb', line 23
def post_converted_name
@post_converted_name ||= if has_post_conversion?
new_variable
else
capture_variable_name
end
end
|
#relevant? ⇒ Boolean
15
16
17
|
# File 'lib/gir_ffi/builders/return_value_builder.rb', line 15
def relevant?
!void_return_value? && !arginfo.skip?
end
|
#return_value_name ⇒ Object
31
32
33
|
# File 'lib/gir_ffi/builders/return_value_builder.rb', line 31
def return_value_name
post_converted_name if has_return_value_name?
end
|