Class: Sigma::ContextExtension
- Inherits:
-
Object
- Object
- Sigma::ContextExtension
- Extended by:
- FFI::Library
- Defined in:
- lib/sigma/context_extension.rb
Overview
User-defined variables to be put into context
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Class Method Summary collapse
-
.create ⇒ ContextExtension
Creates an empty ContextExtension.
-
.with_raw_pointer(pointer) ⇒ ContextExtension
Takes ownership of an existing ContextExtension Pointer.
Instance Method Summary collapse
-
#get_keys ⇒ Array<uint8>
Get all keys in the map.
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
15 16 17 |
# File 'lib/sigma/context_extension.rb', line 15 def pointer @pointer end |
Class Method Details
.create ⇒ ContextExtension
Creates an empty ContextExtension
19 20 21 22 23 |
# File 'lib/sigma/context_extension.rb', line 19 def self.create pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_context_extension_empty(pointer) init(pointer) end |
.with_raw_pointer(pointer) ⇒ ContextExtension
Note:
A user of sigma_rb generally does not need to call this function
Takes ownership of an existing ContextExtension Pointer.
30 31 32 |
# File 'lib/sigma/context_extension.rb', line 30 def self.with_raw_pointer(pointer) init(pointer) end |
Instance Method Details
#get_keys ⇒ Array<uint8>
Get all keys in the map
36 37 38 39 40 41 |
# File 'lib/sigma/context_extension.rb', line 36 def get_keys ce_len = ergo_lib_context_extension_len(self.pointer) b_ptr = FFI::MemoryPointer.new(:uint8, ce_len) ergo_lib_context_extension_keys(self.pointer, b_ptr) b_ptr.get_array_of_uint8(0, ce_len) end |