Class: Sigma::DataInput

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

Overview

Inputs, that are used to enrich script context, but won’t be spent by the transaction

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/data_input.rb', line 14

def pointer
  @pointer
end

Class Method Details

.with_box_id(box_id) ⇒ DataInput

Parse BoxId and create DataInput

Parameters:

Returns:



19
20
21
22
23
# File 'lib/sigma/data_input.rb', line 19

def self.with_box_id(box_id)
  pointer = FFI::MemoryPointer.new(:pointer)
  ergo_lib_data_input_new(box_id.pointer, pointer) 
  init(pointer)
end

.with_raw_pointer(pointer) ⇒ DataInput

Note:

A user of sigma_rb generally does not need to call this function

Takes ownership of an existing DataInput Pointer.

Parameters:

  • pointer (FFI::MemoryPointer)

Returns:



29
30
31
# File 'lib/sigma/data_input.rb', line 29

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

Instance Method Details

#get_box_idBoxId

Get BoxId

Returns:



35
36
37
38
39
# File 'lib/sigma/data_input.rb', line 35

def get_box_id
  pointer = FFI::MemoryPointer.new(:pointer)
  ergo_lib_data_input_new(self.pointer, pointer) 
  Sigma::BoxId.with_raw_pointer(pointer)
end