Module: Grape::Validations

Defined in:
lib/grape/validations.rb,
lib/grape/validations/types.rb,
lib/grape/validations/types/file.rb,
lib/grape/validations/types/json.rb,
lib/grape/validations/params_scope.rb,
lib/grape/validations/validators/base.rb,
lib/grape/validations/validators/coerce.rb,
lib/grape/validations/validators/regexp.rb,
lib/grape/validations/validators/values.rb,
lib/grape/validations/validators/default.rb,
lib/grape/validations/attributes_iterator.rb,
lib/grape/validations/types/build_coercer.rb,
lib/grape/validations/validators/presence.rb,
lib/grape/validations/validators/all_or_none.rb,
lib/grape/validations/validators/allow_blank.rb,
lib/grape/validations/types/custom_type_coercer.rb,
lib/grape/validations/validators/exactly_one_of.rb,
lib/grape/validations/validators/at_least_one_of.rb,
lib/grape/validations/types/multiple_type_coercer.rb,
lib/grape/validations/validators/mutual_exclusion.rb,
lib/grape/validations/validators/multiple_params_base.rb,
lib/grape/validations/types/variant_collection_coercer.rb

Overview

Registry to store and locate known Validators.

Defined Under Namespace

Modules: Types Classes: AllOrNoneOfValidator, AllowBlankValidator, AtLeastOneOfValidator, AttributesIterator, Base, CoerceValidator, DefaultValidator, ExactlyOneOfValidator, MultipleParamsBase, MutualExclusionValidator, ParamsScope, PresenceValidator, RegexpValidator, ValuesValidator

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.validatorsObject

Returns the value of attribute validators


5
6
7
# File 'lib/grape/validations.rb', line 5

def validators
  @validators
end

Class Method Details

.register_validator(short_name, klass) ⇒ Object

Register a new validator, so it can be used to validate parameters.


14
15
16
# File 'lib/grape/validations.rb', line 14

def self.register_validator(short_name, klass)
  validators[short_name] = klass
end