Class: Karafka::Web::Tracking::BaseContract
- Inherits:
-
Core::Contractable::Contract
- Object
- Core::Contractable::Contract
- Karafka::Web::Tracking::BaseContract
- Defined in:
- lib/karafka/web/tracking/base_contract.rb
Overview
Base for all the metric related contracts
Direct Known Subclasses
Consumers::Contracts::ConsumerGroup, Consumers::Contracts::Job, Consumers::Contracts::Partition, Consumers::Contracts::Report, Consumers::Contracts::SubscriptionGroup, Consumers::Contracts::Topic
Class Method Summary collapse
-
.configure ⇒ Object
This layer is not for users extensive feedback, thus we can easily use the minimum error messaging there is.
Instance Method Summary collapse
-
#validate!(data) ⇒ Boolean
True if all good.
Class Method Details
.configure ⇒ Object
This layer is not for users extensive feedback, thus we can easily use the minimum error messaging there is.
11 12 13 14 15 16 17 18 19 |
# File 'lib/karafka/web/tracking/base_contract.rb', line 11 def configure super do |config| config. = YAML.safe_load( File.read( File.join(Karafka::Web.gem_root, 'config', 'locales', 'errors.yml') ) ).fetch('en').fetch('validations').fetch('web') end end |
Instance Method Details
#validate!(data) ⇒ Boolean
Returns true if all good.
25 26 27 |
# File 'lib/karafka/web/tracking/base_contract.rb', line 25 def validate!(data) super(data, Errors::Tracking::ContractError) end |