Class: Borsh::ByteString
- Inherits:
-
Object
- Object
- Borsh::ByteString
- Defined in:
- lib/borsh/byte_string.rb
Instance Method Summary collapse
-
#initialize(value, length) ⇒ ByteString
constructor
A new instance of ByteString.
- #to_borsh ⇒ Object
Constructor Details
#initialize(value, length) ⇒ ByteString
Returns a new instance of ByteString.
2 3 4 5 |
# File 'lib/borsh/byte_string.rb', line 2 def initialize(value, length) @value = value @length = length end |
Instance Method Details
#to_borsh ⇒ Object
7 8 9 10 11 |
# File 'lib/borsh/byte_string.rb', line 7 def to_borsh raise Borsh::ArgumentError, 'ByteString length mismatch' if value.size != length value end |