Class: GirFFI::VFuncImplementation
- Inherits:
-
Object
- Object
- GirFFI::VFuncImplementation
- Defined in:
- lib/gir_ffi/vfunc_implementation.rb
Overview
Simple wrapper class to represent the implementation of a VFunc.
Instance Attribute Summary collapse
-
#implementation ⇒ Object
readonly
Returns the value of attribute implementation.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, implementation) ⇒ VFuncImplementation
constructor
A new instance of VFuncImplementation.
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
#implementation ⇒ Object (readonly)
Returns the value of attribute implementation.
6 7 8 |
# File 'lib/gir_ffi/vfunc_implementation.rb', line 6 def implementation @implementation end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/gir_ffi/vfunc_implementation.rb', line 6 def name @name end |