Module: Kybus::Client::Validator

Extended by:
DRY::ResourceInjector
Defined in:
lib/kybus/client/validator.rb,
lib/kybus/client/validator/jsend.rb,
lib/kybus/client/validator/no_validator.rb

Overview

Allows to validate the responses from another service. Use it to rise exceptions when you detect there were an error.

Defined Under Namespace

Classes: JSend, NoValidator

Class Method Summary collapse

Class Method Details

.build(config) ⇒ Object



14
15
16
# File 'lib/kybus/client/validator.rb', line 14

def build(config)
  resource(:validators, config[:validator] || 'empty').new
end

.register_validator(name, klass) ⇒ Object



18
19
20
# File 'lib/kybus/client/validator.rb', line 18

def register_validator(name, klass)
  register(:validators, name, klass)
end