Class: GoApi::Example

Inherits:
FFI::Struct
  • Object
show all
Defined in:
lib/meshx-plugin-sdk.rb

Instance Method Summary collapse

Constructor Details

#initialize(prefix, id) ⇒ Example

Returns a new instance of Example.



18
19
20
21
# File 'lib/meshx-plugin-sdk.rb', line 18

def initialize(prefix, id)
  self[:prefix] = FFI::MemoryPointer.from_string(prefix)
  self[:id] = id
end

Instance Method Details

#greetObject

This feels convoluted, but it hides the fact that our function is loaded outside of the “struct mirror” class.



25
26
27
# File 'lib/meshx-plugin-sdk.rb', line 25

def greet
  Portal.greet(self)
end