Class: Sigma::TokenAmount
- Inherits:
-
Object
- Object
- Sigma::TokenAmount
- Extended by:
- FFI::Library
- Defined in:
- lib/sigma/token.rb
Instance Attribute Summary collapse
-
#pointer ⇒ Object
Returns the value of attribute pointer.
Class Method Summary collapse
-
.with_i64(int) ⇒ TokenAmount
Create instance from 64-bit Integer with bounds check.
-
.with_raw_pointer(unread_pointer) ⇒ TokenAmount
Takes ownership of an existing TokenAmount Pointer.
Instance Method Summary collapse
-
#==(token_amount_two) ⇒ bool
Equality check.
-
#to_i ⇒ Integer
Get value as 64-bit integer.
Instance Attribute Details
#pointer ⇒ Object
Returns the value of attribute pointer.
14 15 16 |
# File 'lib/sigma/token.rb', line 14 def pointer @pointer end |
Class Method Details
.with_i64(int) ⇒ TokenAmount
Create instance from 64-bit Integer with bounds check
27 28 29 30 31 32 33 |
# File 'lib/sigma/token.rb', line 27 def self.with_i64(int) ptr = FFI::MemoryPointer.new(:pointer) error = ergo_lib_token_amount_from_i64(int, ptr) Util.check_error!(error) init(ptr) end |
.with_raw_pointer(unread_pointer) ⇒ TokenAmount
Note:
A user of sigma_rb generally does not need to call this function
Takes ownership of an existing TokenAmount Pointer.
20 21 22 |
# File 'lib/sigma/token.rb', line 20 def self.with_raw_pointer(unread_pointer) init(unread_pointer) end |
Instance Method Details
#==(token_amount_two) ⇒ bool
Equality check
44 45 46 |
# File 'lib/sigma/token.rb', line 44 def ==(token_amount_two) ergo_lib_token_amount_eq(self.pointer, token_amount_two.pointer) end |
#to_i ⇒ Integer
Get value as 64-bit integer
37 38 39 |
# File 'lib/sigma/token.rb', line 37 def to_i ergo_lib_token_amount_as_i64(self.pointer) end |