Class: Alchemrest::Transforms::Constraint

Inherits:
Object
  • Object
show all
Includes:
AbstractType
Defined in:
lib/alchemrest/transforms/constraint.rb,
lib/alchemrest/transforms/constraint/block.rb,
lib/alchemrest/transforms/constraint/in_list.rb,
lib/alchemrest/transforms/constraint/is_uuid.rb,
lib/alchemrest/transforms/constraint/less_than.rb,
lib/alchemrest/transforms/constraint/max_length.rb,
lib/alchemrest/transforms/constraint/min_length.rb,
lib/alchemrest/transforms/constraint/greater_than.rb,
lib/alchemrest/transforms/constraint/matches_regex.rb,
lib/alchemrest/transforms/constraint/is_instance_of.rb,
lib/alchemrest/transforms/constraint/less_than_or_eq.rb,
lib/alchemrest/transforms/constraint/greater_than_or_eq.rb

Overview

The Alchemrest::Transforms::Constraint class is an abstract base that all other constraints should inherit from A constraint is basically just a predicate with metadata. The ‘meets_conditions?` method is the actual predicate, and description is a human-readable phrase that describes that predicate. We recommend using a phrase that will read well in a sentence like “<input> does not meet the constraint <description>”, since that is how it will display in error messages

Defined Under Namespace

Classes: Block, GreaterThan, GreaterThanOrEq, InList, IsInstanceOf, IsUuid, LessThan, LessThanOrEq, MatchesRegex, MaxLength, MinLength