Class: BSV::Network::UTXO
- Inherits:
-
Object
- Object
- BSV::Network::UTXO
- Defined in:
- lib/bsv/network/utxo.rb
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#satoshis ⇒ Object
readonly
Returns the value of attribute satoshis.
-
#tx_hash ⇒ Object
readonly
Returns the value of attribute tx_hash.
-
#tx_pos ⇒ Object
readonly
Returns the value of attribute tx_pos.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(tx_hash:, tx_pos:, satoshis:, height: nil) ⇒ UTXO
constructor
A new instance of UTXO.
Constructor Details
#initialize(tx_hash:, tx_pos:, satoshis:, height: nil) ⇒ UTXO
Returns a new instance of UTXO.
8 9 10 11 12 13 |
# File 'lib/bsv/network/utxo.rb', line 8 def initialize(tx_hash:, tx_pos:, satoshis:, height: nil) @tx_hash = tx_hash @tx_pos = tx_pos @satoshis = satoshis @height = height end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
6 7 8 |
# File 'lib/bsv/network/utxo.rb', line 6 def height @height end |
#satoshis ⇒ Object (readonly)
Returns the value of attribute satoshis.
6 7 8 |
# File 'lib/bsv/network/utxo.rb', line 6 def satoshis @satoshis end |
#tx_hash ⇒ Object (readonly)
Returns the value of attribute tx_hash.
6 7 8 |
# File 'lib/bsv/network/utxo.rb', line 6 def tx_hash @tx_hash end |
#tx_pos ⇒ Object (readonly)
Returns the value of attribute tx_pos.
6 7 8 |
# File 'lib/bsv/network/utxo.rb', line 6 def tx_pos @tx_pos end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
15 16 17 18 19 |
# File 'lib/bsv/network/utxo.rb', line 15 def ==(other) other.is_a?(self.class) && tx_hash == other.tx_hash && tx_pos == other.tx_pos end |
#hash ⇒ Object
23 24 25 |
# File 'lib/bsv/network/utxo.rb', line 23 def hash [tx_hash, tx_pos].hash end |