Sha256: baa9510a0898118fa8c34ce9b784acc27d66b6b8ceff4838b539d6fd36a04e67

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

module MaxCube
  module Messages
    module TCP
      class Parser
        # NTP server message.
        module MessageF
          private

          # Mandatory hash keys.
          KEYS = %i[ntp_servers].freeze

          def parse_tcp_f(body)
            { ntp_servers: body.split(',') }
          end
        end
      end

      class Serializer
        # Request for NTP servers message (F).
        # Optionally, updates can be done.
        module MessageF
          private

          # Optional hash keys.
          OPT_KEYS = %i[ntp_servers].freeze

          def serialize_tcp_f(hash)
            hash.key?(:ntp_servers) ? hash[:ntp_servers].join(',') : ''
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
maxcube-client-0.5.1 lib/maxcube/messages/tcp/type/f.rb
maxcube-client-0.5.0 lib/maxcube/messages/tcp/type/f.rb