Class: Universa::KeyAddress
- Inherits:
-
RemoteAdapter
- Object
- Delegator
- RemoteAdapter
- Universa::KeyAddress
- Defined in:
- lib/universa/keys.rb
Overview
The com.icodici.crypto.KeyAddress
extension. As it is immutable, caching is used to avoid unnecessary UMI calls.
Class Method Summary collapse
-
.from_packed(binary_string) ⇒ Object
Unpack from binary bytes.
Instance Method Summary collapse
-
#packed ⇒ String
returns binary representation.
-
#to_s ⇒ String
String form of the key which could be used to unpack it back.
Methods inherited from RemoteAdapter
#__getobj__, #__setobj__, #initialize, #inspect, invoke_static, remote_class, remote_class_name
Constructor Details
This class inherits a constructor from Universa::RemoteAdapter
Class Method Details
.from_packed(binary_string) ⇒ Object
Unpack from binary bytes
66 67 68 69 |
# File 'lib/universa/keys.rb', line 66 def self.from_packed(binary_string) binary_string.force_encoding 'binary' KeyAddress.new(binary_string) end |
Instance Method Details
#packed ⇒ String
returns binary representation. It is not a string representation!
73 74 75 76 77 |
# File 'lib/universa/keys.rb', line 73 def packed s = get_packed s.force_encoding 'binary' s end |
#to_s ⇒ String
String form of the key which could be used to unpack it back
60 61 62 |
# File 'lib/universa/keys.rb', line 60 def to_s @string ||= toString() end |