/usr/lib/ruby/vendor_ruby/gir_ffi/builders/ruby_to_c_convertor.rb is in ruby-gir-ffi 0.9.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | module GirFFI
module Builders
# Builder that generates code to convert values from Ruby to C. Used by
# argument builders.
class RubyToCConvertor
def initialize(type_info, argument_name)
@type_info = type_info
@argument_name = argument_name
end
def conversion
args = conversion_arguments @argument_name
"#{@type_info.argument_class_name}.from(#{args})"
end
def conversion_arguments(name)
@type_info.extra_conversion_arguments.map(&:inspect).push(name).join(', ')
end
end
end
end
|