Class: Blockchain::Transaction::Input

Inherits:
Object
  • Object
show all
Defined in:
lib/transaction.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(i) ⇒ Input

Returns a new instance of Input.



37
38
39
40
41
42
43
# File 'lib/transaction.rb', line 37

def initialize(i)
  @script = i['script']
  @prev_out = i['prev_out']
  @addr = @prev_out['addr']
  @n = @prev_out['n']
  @tx_index = @prev_out['tx_index']
end

Instance Attribute Details

#addrObject (readonly)

Returns the value of attribute addr.



35
36
37
# File 'lib/transaction.rb', line 35

def addr
  @addr
end

#nObject (readonly)

Returns the value of attribute n.



35
36
37
# File 'lib/transaction.rb', line 35

def n
  @n
end

#scriptObject (readonly)

Returns the value of attribute script.



35
36
37
# File 'lib/transaction.rb', line 35

def script
  @script
end

#tx_indexObject (readonly)

Returns the value of attribute tx_index.



35
36
37
# File 'lib/transaction.rb', line 35

def tx_index
  @tx_index
end

Instance Method Details

#prev_outObject



45
46
47
# File 'lib/transaction.rb', line 45

def prev_out
  Transaction.find(@tx_index)
end