Sha256: c04eb00e2f295b27c9cce8fb02514bfe73a8ba98cb42c3851f6df841ae7bd1f7

Contents?: true

Size: 493 Bytes

Versions: 19

Compression:

Stored size: 493 Bytes

Contents

# frozen_string_literal: true

class Sbmt::KafkaConsumer::Config::Deserializer < Dry::Struct
  transform_keys(&:to_sym)

  attribute :klass, Sbmt::KafkaConsumer::Types::Strict::String
    .optional
    .default(Sbmt::KafkaConsumer::Serialization::NullDeserializer.to_s.freeze)
  attribute :init_attrs, Sbmt::KafkaConsumer::Types::ConfigAttrs.optional.default({}.freeze)

  def instantiate
    return klass.constantize.new if init_attrs.blank?
    klass.constantize.new(**init_attrs)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
sbmt-kafka_consumer-3.3.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-3.2.2 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-3.2.1 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-3.2.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-3.1.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.8.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-3.0.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.7.1 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.7.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.6.1 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.6.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.5.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.4.1 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.4.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.3.1 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.3.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.2.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.1.0 lib/sbmt/kafka_consumer/config/deserializer.rb
sbmt-kafka_consumer-2.0.0 lib/sbmt/kafka_consumer/config/deserializer.rb