Sha256: bf735e72af8ddb1b7e2771b54b5c1d8cde05136b5cbfe8d5126cb8473d414187

Contents?: true

Size: 662 Bytes

Versions: 2

Compression:

Stored size: 662 Bytes

Contents

module MaxCube
  module Messages
    module TCP
      class Parser
        module MessageF
          private

          KEYS = %i[ntp_servers].freeze

          # NTP server message
          def parse_tcp_f(body)
            { ntp_servers: body.split(',') }
          end
        end
      end

      class Serializer
        module MessageF
          private

          OPT_KEYS = %i[ntp_servers].freeze

          # Request for NTP servers message (F)
          # Optionally, updates can be done
          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.4.1 lib/maxcube/messages/tcp/type/f.rb
maxcube-client-0.4.0 lib/maxcube/messages/tcp/type/f.rb