Class: Nem::Unit::Version
- Inherits:
-
Object
- Object
- Nem::Unit::Version
- Defined in:
- lib/nem/unit/version.rb
Constant Summary collapse
- TESTNET =
-1744830464
0x98 << 24
- MAINNET =
1744830464
0x68 << 24
- MIJIN =
0x60 << 24
- MASK_VERSION =
0x00000003
- MASK_NETWORK =
0xfffffffc
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.
- #network ⇒ Integer
- #to_i ⇒ Integer
- #to_s ⇒ String
- #version ⇒ Integer
Constructor Details
#initialize(value) ⇒ Version
Returns a new instance of Version.
14 15 16 |
# File 'lib/nem/unit/version.rb', line 14 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ String
Returns the current value of value.
4 5 6 |
# File 'lib/nem/unit/version.rb', line 4 def value @value end |
Instance Method Details
#==(other) ⇒ Boolean
45 46 47 |
# File 'lib/nem/unit/version.rb', line 45 def ==(other) version == other end |
#network ⇒ Integer
24 25 26 |
# File 'lib/nem/unit/version.rb', line 24 def network @network ||= value & MASK_NETWORK end |
#to_i ⇒ Integer
40 41 42 |
# File 'lib/nem/unit/version.rb', line 40 def to_i value.to_i end |
#to_s ⇒ String
35 36 37 |
# File 'lib/nem/unit/version.rb', line 35 def to_s to_i.to_s end |
#version ⇒ Integer
19 20 21 |
# File 'lib/nem/unit/version.rb', line 19 def version @version ||= value & MASK_VERSION end |