Module: Ant::Client::Validator

Defined in:
lib/ant/client/validator.rb,
lib/ant/client/validator/jsend.rb,
lib/ant/client/validator/no_validator.rb

Defined Under Namespace

Classes: JSend, NoValidator

Class Method Summary collapse

Class Method Details

.build(config) ⇒ Object



8
9
10
11
12
# File 'lib/ant/client/validator.rb', line 8

def build(config)
  config[:validator] ||= :none
  @validators ||= default_validators
  @validators[config[:validator]].new
end

.default_validatorsObject



14
15
16
17
18
19
20
# File 'lib/ant/client/validator.rb', line 14

def default_validators
  {
    jsend: JSend,
    empty: NoValidator,
    none: NoValidator
  }
end