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.
602 603 604 |
# File 'lib/sigma/ergo_box.rb', line 602 def pointer @pointer end |
Class Method Details
.create(box_value:, tokens:) ⇒ ErgoBoxAssetsData
Create new instance
608 609 610 611 612 |
# File 'lib/sigma/ergo_box.rb', line 608 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.
618 619 620 |
# File 'lib/sigma/ergo_box.rb', line 618 def self.with_raw_pointer(pointer) init(pointer) end |
Instance Method Details
#==(eb_asset_data_two) ⇒ bool
Equality check
641 642 643 |
# File 'lib/sigma/ergo_box.rb', line 641 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
632 633 634 635 636 |
# File 'lib/sigma/ergo_box.rb', line 632 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
624 625 626 627 628 |
# File 'lib/sigma/ergo_box.rb', line 624 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 |