Class: Sigma::BlockIds
- Inherits:
-
Object
- Object
- Sigma::BlockIds
- Extended by:
- FFI::Library
- Defined in:
- lib/sigma/block_header.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
151 152 153 |
# File 'lib/sigma/block_header.rb', line 151 def pointer @pointer end |
Class Method Details
.create ⇒ Object
157 158 159 160 161 162 |
# File 'lib/sigma/block_header.rb', line 157 def self.create pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_block_ids_new(pointer) init(pointer) end |
.with_raw_pointer(unread_pointer) ⇒ Object
153 154 155 |
# File 'lib/sigma/block_header.rb', line 153 def self.with_raw_pointer(unread_pointer) init(unread_pointer) end |
Instance Method Details
#add(block_id) ⇒ Object
168 169 170 |
# File 'lib/sigma/block_header.rb', line 168 def add(block_id) ergo_lib_block_ids_add(block_id.pointer, self.pointer) end |
#get(index) ⇒ Object
172 173 174 175 176 177 178 179 180 181 |
# File 'lib/sigma/block_header.rb', line 172 def get(index) pointer = FFI::MemoryPointer.new(:pointer) res = ergo_lib_block_ids_get(self.pointer, index, pointer) Util.check_error!(res[:error]) if res[:is_some] Sigma::BlockId.with_raw_pointer(pointer) else nil end end |
#len ⇒ Object
164 165 166 |
# File 'lib/sigma/block_header.rb', line 164 def len ergo_lib_block_ids_len(self.pointer) end |