Class: Deimos::SchemaBackends::Plain

Inherits:
Base
  • Object
show all
Defined in:
lib/deimos/schema_backends/plain.rb

Overview

Schema backend that passes through as a basic string.

Instance Attribute Summary

Attributes inherited from Base

#key_schema, #namespace, #schema

Instance Method Summary collapse

Methods inherited from Base

#coerce, content_type, #decode, #encode, field_type, #initialize, #load_schema, mock_backend, #sql_type

Constructor Details

This class inherits a constructor from Deimos::SchemaBackends::Base

Instance Method Details

#coerce_field(_field, value) ⇒ Object



32
33
34
# File 'lib/deimos/schema_backends/plain.rb', line 32

def coerce_field(_field, value)
  value
end

#decode_key(payload, key_id) ⇒ Object



42
43
44
# File 'lib/deimos/schema_backends/plain.rb', line 42

def decode_key(payload, key_id)
  payload[key_id]
end

#decode_payload(payload, schema:) ⇒ Object



13
14
15
# File 'lib/deimos/schema_backends/plain.rb', line 13

def decode_payload(payload, schema:)
  payload
end

#encode_key(key_id, key, topic: nil) ⇒ Object



37
38
39
# File 'lib/deimos/schema_backends/plain.rb', line 37

def encode_key(key_id, key, topic: nil)
  key
end

#encode_payload(payload, schema:, topic: nil) ⇒ Object



18
19
20
# File 'lib/deimos/schema_backends/plain.rb', line 18

def encode_payload(payload, schema:, topic: nil)
  payload.to_s
end

#generate_key_schema(field_name) ⇒ Object



9
10
# File 'lib/deimos/schema_backends/plain.rb', line 9

def generate_key_schema(field_name)
end

#schema_fieldsObject



27
28
29
# File 'lib/deimos/schema_backends/plain.rb', line 27

def schema_fields
  []
end

#validate(payload, schema:) ⇒ Object



23
24
# File 'lib/deimos/schema_backends/plain.rb', line 23

def validate(payload, schema:)
end