Method: CloudFormula::Validator#validate

Defined in:
lib/cloudformula/validator.rb

#validate(value) ⇒ Array

Returns An Array of Strings describing the failure(s) if any checks fail, or an empty Array otherwise.

Parameters:

  • value (Object)

    The value to check against

Returns:

  • (Array)

    An Array of Strings describing the failure(s) if any checks fail, or an empty Array otherwise



37
38
39
40
41
42
43
44
# File 'lib/cloudformula/validator.rb', line 37

def validate(value)
  errors = []
  @validations.each do |rule_name, rule_value|
    rule_result = check_rule Rule.new(rule_name, rule_value), value
    errors += rule_result
  end
  errors
end