Sha256: 8c7c33b74689887ce5ef96c080385dcec6970e9608dc6066bf80c1a1261e7a97
Contents?: true
Size: 849 Bytes
Versions: 1
Compression:
Stored size: 849 Bytes
Contents
# frozen_string_literal: true require 'json' require_relative '../serializer' module Jstreams module Serializers ## # Simple JSON serializer class JSON < Serializer ## # Serializes the given message to a JSON string # # @param [Hash] message Message to serialize # @param [String] _stream Destination stream name (unused) # # @return [String] The JSON serialized message def serialize(message, _stream) ::JSON.generate(message) end ## # Deserializes the given JSON message to a Hash # # @param [Hash] message Message to deserialize # @param [String] _stream Source stream name (unused) # # @return [Hash] The deserialized message def deserialize(message, _stream) ::JSON.parse(message) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jstreams-0.1.0.alpha | lib/jstreams/serializers/json.rb |