Module: Karafka::Core::Configurable

Included in:
Karafka::Core::Contractable::Contract
Defined in:
lib/karafka/core/configurable.rb,
lib/karafka/core/configurable/leaf.rb,
lib/karafka/core/configurable/node.rb

Overview

A simple dry-configuration API compatible module for defining settings with defaults and a constructor.

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Leaf, Node

Class Method Summary collapse

Class Method Details

.extended(base) ⇒ Object

Sets up all the class methods and inits the core root node. Useful when only per class settings are needed as does not include instance methods

Parameters:

  • base (Class)

    class that we extend



17
18
19
# File 'lib/karafka/core/configurable.rb', line 17

def extended(base)
  base.extend ClassMethods
end

.included(base) ⇒ Object

Sets up all the class and instance methods and inits the core root node

Needs to be used when per instance configuration is needed

Parameters:

  • base (Class)

    class to which we want to add configuration



26
27
28
29
# File 'lib/karafka/core/configurable.rb', line 26

def included(base)
  base.include InstanceMethods
  base.extend self
end