Class: Sigma::BlockHeader

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pointerObject

Returns the value of attribute pointer.



13
14
15
# File 'lib/sigma/block_header.rb', line 13

def pointer
  @pointer
end

Class Method Details

.with_json(json) ⇒ Object



15
16
17
18
19
20
# File 'lib/sigma/block_header.rb', line 15

def self.with_json(json)
  pointer = FFI::MemoryPointer.new(:pointer) 
  error = ergo_lib_block_header_from_json(json, pointer)
  Util.check_error!(error)
  init(pointer)
end

.with_raw_pointer(pointer) ⇒ Object



22
23
24
# File 'lib/sigma/block_header.rb', line 22

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

Instance Method Details

#==(bh_two) ⇒ Object



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

def ==(bh_two)
  ergo_lib_block_header_eq(self.pointer, bh_two.pointer)
end

#get_block_idObject



26
27
28
29
30
# File 'lib/sigma/block_header.rb', line 26

def get_block_id
  pointer = FFI::MemoryPointer.new(:pointer) 
  ergo_lib_block_header_id(self.pointer, pointer)
  Sigma::BlockId.with_raw_pointer(:pointer)
end