Sha256: 407d1b0247c4d851a260b102b223b130a6e7125423aed9ca276200edd887b693

Contents?: true

Size: 450 Bytes

Versions: 19

Compression:

Stored size: 450 Bytes

Contents

# frozen_string_literal: true

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

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

  def consumer_klass
    target_klass = klass.constantize

    return target_klass.consumer_klass if init_attrs.blank?

    target_klass.consumer_klass(**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/consumer.rb
sbmt-kafka_consumer-3.2.2 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-3.2.1 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-3.2.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-3.1.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.8.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-3.0.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.7.1 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.7.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.6.1 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.6.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.5.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.4.1 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.4.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.3.1 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.3.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.2.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.1.0 lib/sbmt/kafka_consumer/config/consumer.rb
sbmt-kafka_consumer-2.0.0 lib/sbmt/kafka_consumer/config/consumer.rb