Class: Sigma::ErgoBoxAssetsDataList
- Inherits:
-
Object
- Object
- Sigma::ErgoBoxAssetsDataList
- Extended by:
- FFI::Library
- Defined in:
- lib/sigma/ergo_box.rb
Overview
An ordered collection of ErgoBoxAssetsData
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Class Method Summary collapse
-
.create ⇒ ErgoBoxAssetsDataList
Create an empty collection.
-
.with_raw_pointer(unread_pointer) ⇒ ErgoBoxAssetsDataList
Takes ownership of an existing ErgoBoxAssetsDataList Pointer.
Instance Method Summary collapse
-
#add(ergo_box_assets_data) ⇒ Object
Add to collection.
-
#get(index) ⇒ ErgoBoxAssetsData?
Get item at specified index or return nil if no item exists.
-
#len ⇒ Integer
Get length of collection.
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
670 671 672 |
# File 'lib/sigma/ergo_box.rb', line 670 def pointer @pointer end |
Class Method Details
.create ⇒ ErgoBoxAssetsDataList
Create an empty collection
682 683 684 685 686 687 |
# File 'lib/sigma/ergo_box.rb', line 682 def self.create pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_ergo_box_assets_data_list_new(pointer) init(pointer) end |
.with_raw_pointer(unread_pointer) ⇒ ErgoBoxAssetsDataList
Note:
A user of sigma_rb generally does not need to call this function
Takes ownership of an existing ErgoBoxAssetsDataList Pointer.
676 677 678 |
# File 'lib/sigma/ergo_box.rb', line 676 def self.with_raw_pointer(unread_pointer) init(unread_pointer) end |
Instance Method Details
#add(ergo_box_assets_data) ⇒ Object
Add to collection
697 698 699 |
# File 'lib/sigma/ergo_box.rb', line 697 def add(ergo_box_assets_data) ergo_lib_ergo_box_assets_data_list_add(ergo_box_assets_data.pointer, self.pointer) end |
#get(index) ⇒ ErgoBoxAssetsData?
Get item at specified index or return nil if no item exists
704 705 706 707 708 709 710 711 712 713 |
# File 'lib/sigma/ergo_box.rb', line 704 def get(index) pointer = FFI::MemoryPointer.new(:pointer) res = ergo_lib_ergo_box_assets_data_list_get(self.pointer, index, pointer) Util.check_error!(res[:error]) if res[:is_some] Sigma::ErgoBoxAssetsData.with_raw_pointer(pointer) else nil end end |
#len ⇒ Integer
Get length of collection
691 692 693 |
# File 'lib/sigma/ergo_box.rb', line 691 def len ergo_lib_ergo_box_assets_data_list_len(self.pointer) end |