Sha256: df771b44eec50185a3e7ad2d6b7e6f5fbbc0bdd4a44ce5d3b9dbd3f57de204f0
Contents?: true
Size: 940 Bytes
Versions: 34
Compression:
Stored size: 940 Bytes
Contents
# frozen_string_literal: true module Deimos module SchemaBackends # Mock implementation of a schema backend that does no encoding or validation. class Mock < Base # @override def decode_payload(payload, schema:) payload.is_a?(String) ? 'payload-decoded' : payload.map { |k, v| [k, "decoded-#{v}"] } end # @override def encode_payload(payload, schema:, topic: nil) payload.is_a?(String) ? 'payload-encoded' : payload.map { |k, v| [k, "encoded-#{v}"] } end # @override def validate(payload, schema:) end # @override def schema_fields [] end # @override def coerce_field(_field, value) value end # @override def encode_key(key_id, key, topic: nil) { key_id => key } end # @override def decode_key(payload, key_id) payload[key_id] end end end end
Version data entries
34 entries across 34 versions & 1 rubygems