Class: Sigma::ErgoBoxAssetsData
- Inherits:
-
Object
- Object
- Sigma::ErgoBoxAssetsData
- Extended by:
- FFI::Library
- Defined in:
- lib/sigma/ergo_box.rb
Overview
Pair of (value, tokens) for a box
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Class Method Summary collapse
-
.create(box_value:, tokens:) ⇒ ErgoBoxAssetsData
Create new instance.
-
.with_raw_pointer(pointer) ⇒ ErgoBoxAssetsData
Takes ownership of an existing ErgoBoxAssetsData Pointer.
Instance Method Summary collapse
-
#==(eb_asset_data_two) ⇒ bool
Equality check.
-
#get_box_tokens ⇒ Tokens
get box tokens.
-
#get_box_value ⇒ BoxValue
get box value.
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
598 599 600 |
# File 'lib/sigma/ergo_box.rb', line 598 def pointer @pointer end |
Class Method Details
.create(box_value:, tokens:) ⇒ ErgoBoxAssetsData
Create new instance
604 605 606 607 608 |
# File 'lib/sigma/ergo_box.rb', line 604 def self.create(box_value:, tokens:) pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_ergo_box_assets_data_new(box_value.pointer, tokens.pointer, pointer) init(pointer) end |
.with_raw_pointer(pointer) ⇒ ErgoBoxAssetsData
Note:
A user of sigma_rb generally does not need to call this function
Takes ownership of an existing ErgoBoxAssetsData Pointer.
614 615 616 |
# File 'lib/sigma/ergo_box.rb', line 614 def self.with_raw_pointer(pointer) init(pointer) end |
Instance Method Details
#==(eb_asset_data_two) ⇒ bool
Equality check
637 638 639 |
# File 'lib/sigma/ergo_box.rb', line 637 def ==(eb_asset_data_two) ergo_lib_ergo_box_assets_data_eq(self.pointer, eb_asset_data_two.pointer) end |
#get_box_tokens ⇒ Tokens
get box tokens
628 629 630 631 632 |
# File 'lib/sigma/ergo_box.rb', line 628 def get_box_tokens pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_ergo_box_assets_data_tokens(self.pointer, pointer) Sigma::Tokens.with_raw_pointer(pointer) end |
#get_box_value ⇒ BoxValue
get box value
620 621 622 623 624 |
# File 'lib/sigma/ergo_box.rb', line 620 def get_box_value pointer = FFI::MemoryPointer.new(:pointer) ergo_lib_ergo_box_assets_data_value(self.pointer, pointer) Sigma::BoxValue.with_raw_pointer(pointer) end |