Sha256: 0bfb01a20e4a62e5f55fb31cb0ac229a99d30d7b08e10feee91e35d8b1883c6a

Contents?: true

Size: 823 Bytes

Versions: 10

Compression:

Stored size: 823 Bytes

Contents

# frozen_string_literal: true

module Deimos
  module SchemaBackends
    # Schema backend that passes through as a basic string.
    class Plain < Base

      # @override
      def generate_key_schema(field_name)
      end

      # @override
      def decode_payload(payload, schema:)
        payload
      end

      # @override
      def encode_payload(payload, schema:, topic: nil)
        payload.to_s
      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
      end

      # @override
      def decode_key(payload, key_id)
        payload[key_id]
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
deimos-ruby-2.0.0.pre.beta3 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.beta2 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.beta1 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.alpha7 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.alpha6 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.alpha5 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.alpha4 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.alpha3 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.alpha2 lib/deimos/schema_backends/plain.rb
deimos-ruby-2.0.0.pre.alpha1 lib/deimos/schema_backends/plain.rb