Class: GirFFI::Builders::CToRubyConvertor
- Inherits:
-
Object
- Object
- GirFFI::Builders::CToRubyConvertor
- Defined in:
- lib/gir_ffi/builders/c_to_ruby_convertor.rb
Instance Method Summary collapse
- #conversion ⇒ Object
-
#initialize(type_info, argument_name, length_arg) ⇒ CToRubyConvertor
constructor
A new instance of CToRubyConvertor.
Constructor Details
#initialize(type_info, argument_name, length_arg) ⇒ CToRubyConvertor
Returns a new instance of CToRubyConvertor.
2 3 4 5 6 |
# File 'lib/gir_ffi/builders/c_to_ruby_convertor.rb', line 2 def initialize type_info, argument_name, length_arg @type_info = type_info @argument_name = argument_name @length_arg = length_arg end |
Instance Method Details
#conversion ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/gir_ffi/builders/c_to_ruby_convertor.rb', line 8 def conversion case @type_info.flattened_tag when :utf8, :filename "#{@argument_name}.to_utf8" else "#{@type_info.argument_class_name}.wrap(#{conversion_arguments})" end end |