Class: Tapyrus::PSTT::KeyValue
- Inherits:
-
Struct
- Object
- Struct
- Tapyrus::PSTT::KeyValue
- Defined in:
- lib/tapyrus/pstt.rb
Overview
A single key-value record of a PSTT map.
Instance Attribute Summary collapse
-
#keydata ⇒ Object
Returns the value of attribute keydata.
-
#type ⇒ Object
Returns the value of attribute type.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#key ⇒ String
The complete key(
and ). - #to_payload ⇒ Object
Instance Attribute Details
#keydata ⇒ Object
Returns the value of attribute keydata
94 95 96 |
# File 'lib/tapyrus/pstt.rb', line 94 def keydata @keydata end |
#type ⇒ Object
Returns the value of attribute type
94 95 96 |
# File 'lib/tapyrus/pstt.rb', line 94 def type @type end |
#value ⇒ Object
Returns the value of attribute value
94 95 96 |
# File 'lib/tapyrus/pstt.rb', line 94 def value @value end |
Instance Method Details
#key ⇒ String
The complete key(
98 99 100 |
# File 'lib/tapyrus/pstt.rb', line 98 def key Tapyrus.pack_var_int(type) + keydata end |
#to_payload ⇒ Object
102 103 104 105 |
# File 'lib/tapyrus/pstt.rb', line 102 def to_payload k = key Tapyrus.pack_var_int(k.bytesize) + k + Tapyrus.pack_var_int(value.bytesize) + value end |