Class: OpenAssets::Transaction::OutPoint
- Inherits:
-
Object
- Object
- OpenAssets::Transaction::OutPoint
- Defined in:
- lib/openassets/transaction/out_point.rb
Overview
The combination of a transaction hash and an index n into its vout
Instance Attribute Summary collapse
-
#hash ⇒ Object
Returns the value of attribute hash.
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
-
#initialize(hash, index) ⇒ OutPoint
constructor
A new instance of OutPoint.
Constructor Details
#initialize(hash, index) ⇒ OutPoint
Returns a new instance of OutPoint.
12 13 14 15 16 17 |
# File 'lib/openassets/transaction/out_point.rb', line 12 def initialize(hash, index) raise ArgumentError, 'hash must be exactly 32 bytes.' unless [hash].pack("H*").bytesize == 32 raise ArgumentError, 'index must be in range 0x0 to 0xffffffff.' unless index.between?(0x0, 0xffffffff) @hash = hash @index = index end |
Instance Attribute Details
#hash ⇒ Object
Returns the value of attribute hash.
7 8 9 |
# File 'lib/openassets/transaction/out_point.rb', line 7 def hash @hash end |
#index ⇒ Object
Returns the value of attribute index.
8 9 10 |
# File 'lib/openassets/transaction/out_point.rb', line 8 def index @index end |