Class: Libra::AccountAddress
- Inherits:
-
Object
- Object
- Libra::AccountAddress
- Defined in:
- lib/libra/account_address.rb
Constant Summary collapse
- ADDRESS_LENGTH =
32
- SHORT_STRING_LENGTH =
4
- LIBRA_NETWORK_ID_SHORT =
"lb"
Instance Attribute Summary collapse
-
#addr ⇒ Object
Returns the value of attribute addr.
-
#hex ⇒ Object
Returns the value of attribute hex.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hex_literal) ⇒ AccountAddress
constructor
A new instance of AccountAddress.
Constructor Details
#initialize(hex_literal) ⇒ AccountAddress
Returns a new instance of AccountAddress.
15 16 17 18 |
# File 'lib/libra/account_address.rb', line 15 def initialize(hex_literal) @hex = hex_literal @addr = [hex_literal].pack('H*') end |
Instance Attribute Details
#addr ⇒ Object
Returns the value of attribute addr.
12 13 14 |
# File 'lib/libra/account_address.rb', line 12 def addr @addr end |
#hex ⇒ Object
Returns the value of attribute hex.
13 14 15 |
# File 'lib/libra/account_address.rb', line 13 def hex @hex end |
Class Method Details
.from_public_key ⇒ Object
24 25 26 |
# File 'lib/libra/account_address.rb', line 24 def self.from_public_key #TODO end |
.hex_to_bytes(hex_literal) ⇒ Object
20 21 22 |
# File 'lib/libra/account_address.rb', line 20 def self.hex_to_bytes(hex_literal) [hex_literal].pack('H*') end |