Class: Karafka::Contracts::Base

Inherits:
Karafka::Core::Contractable::Contract
  • Object
show all
Defined in:
lib/karafka/contracts/base.rb

Overview

Base contract for all Karafka contracts

Instance Method Summary collapse

Instance Method Details

#validate!(data) ⇒ Boolean

Note:

We use contracts only in the config validation context, so no need to add support for multiple error classes. It will be added when it will be needed.

Returns true if all good.

Parameters:

  • data (Hash)

    data for validation

Returns:

  • (Boolean)

    true if all good

Raises:



12
13
14
# File 'lib/karafka/contracts/base.rb', line 12

def validate!(data)
  super(data, Errors::InvalidConfigurationError)
end