Sha256: 46cad58009272d17975ce8899df44310cbc4871a35b5c7e58bd90d09db82b77f
Contents?: true
Size: 823 Bytes
Versions: 11
Compression:
Stored size: 823 Bytes
Contents
# frozen_string_literal: true module Karafka module Web module Tracking module Consumers module Contracts # Expected data for each subscription group # It's mostly about topics details class SubscriptionGroup < Web::Contracts::Base configure required(:id) { |val| val.is_a?(String) && !val.empty? } required(:topics) { |val| val.is_a?(Hash) } required(:state) { |val| val.is_a?(Hash) } virtual do |data, errors| next unless errors.empty? topic_contract = Topic.new data.fetch(:topics).each_value do |details| topic_contract.validate!(details) end nil end end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems