Class: Tapyrus::Message::Pong
Overview
pong message bitcoin.org/en/developer-reference#pong
Constant Summary collapse
- COMMAND =
"pong"
Constants included from Util
Instance Attribute Summary collapse
-
#nonce ⇒ Object
readonly
Returns the value of attribute nonce.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(nonce) ⇒ Pong
constructor
A new instance of Pong.
- #to_payload ⇒ Object
Methods inherited from Base
Methods included from Util
#byte_to_bit, #calc_checksum, #decode_base58_address, #double_sha256, #encode_base58_address, #hash160, #hmac_sha256, #pack_boolean, #pack_var_int, #pack_var_string, #padding_zero, #sha256, #unpack_boolean, #unpack_var_int, #unpack_var_int_from_io, #unpack_var_string, #valid_address?
Methods included from HexConverter
Constructor Details
#initialize(nonce) ⇒ Pong
Returns a new instance of Pong.
10 11 12 |
# File 'lib/tapyrus/message/pong.rb', line 10 def initialize(nonce) @nonce = nonce end |
Instance Attribute Details
#nonce ⇒ Object (readonly)
Returns the value of attribute nonce.
8 9 10 |
# File 'lib/tapyrus/message/pong.rb', line 8 def nonce @nonce end |
Class Method Details
.parse_from_payload(payload) ⇒ Object
14 15 16 |
# File 'lib/tapyrus/message/pong.rb', line 14 def self.parse_from_payload(payload) new(payload.unpack("Q").first) end |
Instance Method Details
#to_payload ⇒ Object
18 19 20 |
# File 'lib/tapyrus/message/pong.rb', line 18 def to_payload [nonce].pack("Q") end |