Class: Karafka::Web::Contracts::Base
- Inherits:
-
Core::Contractable::Contract
- Object
- Core::Contractable::Contract
- Karafka::Web::Contracts::Base
- Defined in:
- lib/karafka/web/contracts/base.rb
Overview
Base for all the contracts
Direct Known Subclasses
Config, Processing::Consumers::Contracts::AggregatedStats, Processing::Consumers::Contracts::Metrics, Processing::Consumers::Contracts::Process, Processing::Consumers::Contracts::State, Processing::Consumers::Contracts::TopicStats, Tracking::Consumers::Contracts::ConsumerGroup, Tracking::Consumers::Contracts::Job, Tracking::Consumers::Contracts::Partition, Tracking::Consumers::Contracts::Report, Tracking::Consumers::Contracts::SubscriptionGroup, Tracking::Consumers::Contracts::Topic, Tracking::Contracts::Error
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.
12 13 14 15 16 17 18 19 20 |
# File 'lib/karafka/web/contracts/base.rb', line 12 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.
26 27 28 |
# File 'lib/karafka/web/contracts/base.rb', line 26 def validate!(data) super(data, Errors::ContractError) end |