Sha256: c748d9880a5550d39dcddd9a59232ee596aef9ecf41385d70012e3357b0fb293

Contents?: true

Size: 405 Bytes

Versions: 14

Compression:

Stored size: 405 Bytes

Contents

module Bitcoin
  module Message

    # pong message
    # https://bitcoin.org/en/developer-reference#pong
    class Pong < Base

      COMMAND = 'pong'

      attr_reader :nonce

      def initialize(nonce)
        @nonce = nonce
      end

      def self.parse_from_payload(payload)
        new(payload.unpack1('Q'))
      end

      def to_payload
        [nonce].pack('Q')
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bitcoinrb-1.7.0 lib/bitcoin/message/pong.rb
bitcoinrb-1.6.0 lib/bitcoin/message/pong.rb
bitcoinrb-1.5.0 lib/bitcoin/message/pong.rb
bitcoinrb-1.4.0 lib/bitcoin/message/pong.rb
bitcoinrb-1.3.0 lib/bitcoin/message/pong.rb
bitcoinrb-1.2.1 lib/bitcoin/message/pong.rb
bitcoinrb-1.2.0 lib/bitcoin/message/pong.rb
bitcoinrb-1.1.1 lib/bitcoin/message/pong.rb
bitcoinrb-1.1.0 lib/bitcoin/message/pong.rb
bitcoinrb-1.0.0 lib/bitcoin/message/pong.rb
bitcoinrb-0.9.0 lib/bitcoin/message/pong.rb
bitcoinrb-0.8.0 lib/bitcoin/message/pong.rb
bitcoinrb-0.7.0 lib/bitcoin/message/pong.rb
bitcoinrb-0.6.0 lib/bitcoin/message/pong.rb