Class: GirFFI::Builders::ClosureConvertor

Inherits:
Object
  • Object
show all
Defined in:
lib/gir_ffi/builders/closure_convertor.rb

Overview

Builder that generates code to convert closure arguments (‘user data’) from C to Ruby. Used by argument builders.

Instance Method Summary collapse

Constructor Details

#initialize(argument_name) ⇒ ClosureConvertor

Returns a new instance of ClosureConvertor.



8
9
10
# File 'lib/gir_ffi/builders/closure_convertor.rb', line 8

def initialize(argument_name)
  @argument_name = argument_name
end

Instance Method Details

#conversionObject



12
13
14
# File 'lib/gir_ffi/builders/closure_convertor.rb', line 12

def conversion
  "GirFFI::ArgHelper::OBJECT_STORE.fetch(#{@argument_name})"
end