Class: Sigma::TokenAmount

Inherits:
Object
  • Object
show all
Extended by:
FFI::Library
Defined in:
lib/sigma/token.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pointerObject

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) ⇒ Object



20
21
22
23
24
25
26
# File 'lib/sigma/token.rb', line 20

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) ⇒ Object



16
17
18
# File 'lib/sigma/token.rb', line 16

def self.with_raw_pointer(unread_pointer)
  init(unread_pointer)
end

Instance Method Details

#==(token_amount_two) ⇒ Object



32
33
34
# File 'lib/sigma/token.rb', line 32

def ==(token_amount_two)
  ergo_lib_token_amount_eq(self.pointer, token_amount_two.pointer)
end

#to_iObject



28
29
30
# File 'lib/sigma/token.rb', line 28

def to_i
  ergo_lib_token_amount_as_i64(self.pointer)
end