Class: GirFFI::VFuncImplementation

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

Overview

Simple wrapper class to represent the implementation of a VFunc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, implementation) ⇒ VFuncImplementation

Returns a new instance of VFuncImplementation.



8
9
10
11
12
# File 'lib/gir_ffi/vfunc_implementation.rb', line 8

def initialize(name, implementation)
  implementation ||= ->(obj, *args) { obj.public_send name, *args }
  @name = name
  @implementation = implementation
end

Instance Attribute Details

#implementationObject (readonly)

Returns the value of attribute implementation.



6
7
8
# File 'lib/gir_ffi/vfunc_implementation.rb', line 6

def implementation
  @implementation
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/gir_ffi/vfunc_implementation.rb', line 6

def name
  @name
end