Class: Blockchain::Transaction::Input
- Inherits:
-
Object
- Object
- Blockchain::Transaction::Input
- Defined in:
- lib/transaction.rb
Instance Attribute Summary collapse
-
#addr ⇒ Object
readonly
Returns the value of attribute addr.
-
#n ⇒ Object
readonly
Returns the value of attribute n.
-
#script ⇒ Object
readonly
Returns the value of attribute script.
-
#tx_index ⇒ Object
readonly
Returns the value of attribute tx_index.
Instance Method Summary collapse
-
#initialize(i) ⇒ Input
constructor
A new instance of Input.
- #prev_out ⇒ Object
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
#addr ⇒ Object (readonly)
Returns the value of attribute addr.
35 36 37 |
# File 'lib/transaction.rb', line 35 def addr @addr end |
#n ⇒ Object (readonly)
Returns the value of attribute n.
35 36 37 |
# File 'lib/transaction.rb', line 35 def n @n end |
#script ⇒ Object (readonly)
Returns the value of attribute script.
35 36 37 |
# File 'lib/transaction.rb', line 35 def script @script end |
#tx_index ⇒ Object (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_out ⇒ Object
45 46 47 |
# File 'lib/transaction.rb', line 45 def prev_out Transaction.find(@tx_index) end |