module JsonTableSchema::Constraints::MinLength

Public Instance Methods

check_min_length() click to toggle source
# File lib/jsontableschema/constraints/min_length.rb, line 5
def check_min_length
  return if @value.nil?
  if @value.length < @constraints['minLength'].to_i
    raise JsonTableSchema::ConstraintError.new("The field `#{@field['name']}` must have a minimum length of #{@constraints['minLength']}")
  end
  true
end