Class: Sbmt::KafkaProducer::Config::Producer

Inherits:
Anyway::Config
  • Object
show all
Defined in:
lib/sbmt/kafka_producer/config/producer.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.coerce_to(struct) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/sbmt/kafka_producer/config/producer.rb', line 12

def coerce_to(struct)
  lambda do |raw_attrs|
    struct.new(**raw_attrs)
  rescue Dry::Types::SchemaError => e
    raise_validation_error "cannot parse #{struct}: #{e.message}"
  end
end

Instance Method Details

#to_kafka_optionsObject



43
44
45
46
# File 'lib/sbmt/kafka_producer/config/producer.rb', line 43

def to_kafka_options
  kafka.to_kafka_options
    .merge(auth.to_kafka_options)
end