Class: Nis::Unit::Version
- Inherits:
-
Object
- Object
- Nis::Unit::Version
- Defined in:
- lib/nis/unit/version.rb
Constant Summary collapse
- MAINNET =
1744830465- TESTNET =
-1744830463
Instance Attribute Summary collapse
-
#value ⇒ String
The current value of value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(value) ⇒ Version
constructor
A new instance of Version.
- #mainnet? ⇒ Boolean
- #testnet? ⇒ Boolean
- #to_s ⇒ Object
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) ⇒ Object
29 30 31 |
# File 'lib/nis/unit/version.rb', line 29 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 ⇒ Object
23 24 25 26 27 |
# File 'lib/nis/unit/version.rb', line 23 def to_s testnet? ? 'testnet' : mainnet? ? 'mainnet' : 'unexpected' end |