Class: Nis::Unit::Version
- Inherits:
-
Object
- Object
- Nis::Unit::Version
- Defined in:
- lib/nis/unit/version.rb
Constant Summary collapse
- MAINNET =
1_744_830_465
- TESTNET =
-1_744_830_463
Instance Attribute Summary collapse
-
#value ⇒ String
The current value of value.
Instance Method Summary collapse
- #==(other) ⇒ Boolean
-
#initialize(value) ⇒ Version
constructor
A new instance of Version.
- #mainnet? ⇒ Boolean
- #testnet? ⇒ Boolean
- #to_s ⇒ String
Constructor Details
#initialize(value) ⇒ Version
Returns a new instance of Version.
9 10 11 |
# File 'lib/nis/unit/version.rb', line 9 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ String
Returns the current value of value.
3 4 5 |
# File 'lib/nis/unit/version.rb', line 3 def value @value end |
Instance Method Details
#==(other) ⇒ Boolean
31 32 33 |
# File 'lib/nis/unit/version.rb', line 31 def ==(other) @value == other.value end |
#mainnet? ⇒ Boolean
14 15 16 |
# File 'lib/nis/unit/version.rb', line 14 def mainnet? @value == MAINNET end |
#testnet? ⇒ Boolean
19 20 21 |
# File 'lib/nis/unit/version.rb', line 19 def testnet? @value == TESTNET end |
#to_s ⇒ String
24 25 26 27 28 |
# File 'lib/nis/unit/version.rb', line 24 def to_s testnet? ? 'testnet' : mainnet? ? 'mainnet' : 'unexpected' end |