Sha256: 81c11558c3b86088afebb865067b1aadccd11be3181a0185798b836f7118298f

Contents?: true

Size: 820 Bytes

Versions: 1

Compression:

Stored size: 820 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable Lint/UnusedMethodArgument

module Jstreams
  ##
  # @abstract
  class Serializer
    ##
    # Serialize a message from a hash into a string
    #
    # @param [Hash] message Message to serialize
    # @param [String] stream Destination stream name
    #
    # @return [String] The serialized message
    #
    # @abstract
    def serialize(message, stream)
      raise NotImplementedError
    end

    ##
    # Deserialize a message from a string into a hash
    #
    # @param [String] message Message to deserialize
    # @param [String] stream Source stream name
    #
    # @return [Hash] The deserialized message
    #
    # @abstract
    def deserialize(message, stream)
      raise NotImplementedError
    end
  end
end

# rubocop:enable Lint/UnusedMethodArgument

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jstreams-0.1.0.alpha lib/jstreams/serializer.rb