Class: Karafka::Pro::Routing::Features::Filtering::Config
- Inherits:
-
Struct
- Object
- Struct
- Karafka::Pro::Routing::Features::Filtering::Config
- Defined in:
- lib/karafka/pro/routing/features/filtering/config.rb
Overview
Filtering feature configuration
Instance Attribute Summary collapse
-
#factories ⇒ Object
Returns the value of attribute factories.
Instance Method Summary collapse
-
#active? ⇒ Boolean
Is this feature in use.
-
#filters ⇒ Array<Object>
Array of filters applicable to a topic partition.
-
#to_h ⇒ Hash
This config hash.
Instance Attribute Details
#factories ⇒ Object
Returns the value of attribute factories
20 21 22 |
# File 'lib/karafka/pro/routing/features/filtering/config.rb', line 20 def factories @factories end |
Instance Method Details
#active? ⇒ Boolean
Returns is this feature in use. Are any filters defined.
22 23 24 |
# File 'lib/karafka/pro/routing/features/filtering/config.rb', line 22 def active? !factories.empty? end |
#filters ⇒ Array<Object>
Returns array of filters applicable to a topic partition.
27 28 29 |
# File 'lib/karafka/pro/routing/features/filtering/config.rb', line 27 def filters factories.map(&:call) end |
#to_h ⇒ Hash
Returns this config hash.
32 33 34 |
# File 'lib/karafka/pro/routing/features/filtering/config.rb', line 32 def to_h super.merge(active: active?) end |