Class: Etheruby::Encoders::String
- Inherits:
-
Base
- Object
- Base
- Etheruby::Encoders::String
show all
- Defined in:
- lib/etheruby/encoders/string.rb
Instance Attribute Summary
Attributes inherited from Base
#data
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#decode ⇒ Object
11
12
13
14
|
# File 'lib/etheruby/encoders/string.rb', line 11
def decode
v, s = Bytes.new(data).decode
return v.pack('U*'), s
end
|
#encode ⇒ Object
7
8
9
|
# File 'lib/etheruby/encoders/string.rb', line 7
def encode
Bytes.new(data.codepoints).encode
end
|