Skip to content

Commit

Permalink
Documentation format for all constraints.
Browse files Browse the repository at this point in the history
  • Loading branch information
tamdaz committed Dec 13, 2024
1 parent 7f8bb21 commit 497f5ff
Show file tree
Hide file tree
Showing 32 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/blank.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is blank; meaning equal to an empty string or `nil`.
#
# ```crystal
# ```
# class Profile
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/choice.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Validates that a value is one of a given set of valid choices;
# can also be used to validate that each item in a collection is one of those valid values.
#
# ```crystal
# ```
# class User
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/email.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class User
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/equal_to.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is equal to another.
#
# ```crystal
# ```
# class Project
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/file.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require "mime"
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class Profile
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/greater_than.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is greater than another.
#
# ```crystal
# ```
# class Person
# include AVD::Validatable
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is greater than or equal to another.
#
# ```crystal
# ```
# class Person
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/image.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require "athena-image_size"
#
# See `AVD::Constraints::File` for common documentation.
#
# ```crystal
# ```
# class Profile
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/ip.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require "socket"
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class Machine
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/is_false.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is `false`.
#
# ```crystal
# ```
# class Post
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/is_nil.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is `nil`.
#
# ```crystal
# ```
# class Post
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/is_true.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is `true`.
#
# ```crystal
# ```
# class Post
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/isbn.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class Book
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/isin.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class UnitAccount
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/issn.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class Journal
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/less_than.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is less than another.
#
# ```crystal
# ```
# class Employee
# include AVD::Validatable
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is less than or equal to another.
#
# ```crystal
# ```
# class Employee
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/luhn.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class Transaction
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/negative.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Validates that a value is a negative number.
# Use `AVD::Constraints::NegativeOrZero` if you wish to also allow `0`.
#
# ```crystal
# ```
# class Mall
# include AVD::Validatable
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Validates that a value is a negative number, or `0`.
# Use `AVD::Constraints::Negative` if you don't want to allow `0`.
#
# ```crystal
# ```
# class Mall
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/not_blank.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is not blank; meaning not equal to a blank string, an empty `Iterable`, `false`, or optionally `nil`.
#
# ```crystal
# ```
# class User
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/not_equal_to.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a value is not equal to another.
#
# ```crystal
# ```
# class User
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/not_nil.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# NOTE: Due to Crystal's static typing, when validating objects the property's type must be nilable,
# otherwise `nil` is inherently not allowed due to the compiler's type checking.
#
# ```crystal
# ```
# class Post
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/optional.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Allows wrapping `AVD::Constraint`(s) to denote it as being optional within an `AVD::Constraints::Collection`.
# See [this][Athena::Validator::Constraints::Collection--required-and-optional-constraints] for more information.
#
# ```crystal
# ```
# class Post
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/positive.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Validates that a value is a positive number.
# Use `AVD::Constraints::PositiveOrZero` if you wish to also allow `0`.
#
# ```crystal
# ```
# class Account
# include AVD::Validatable
#
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Validates that a value is a positive number, or `0`.
# Use `AVD::Constraints::Positive` if you don't want to allow `0`.
#
# ```crystal
# ```
# class Account
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/range.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that a `Number` or `Time` value is between some minimum and maximum.
#
# ```crystal
# ```
# class House
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/regex.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class User
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/required.cr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Allows wrapping `AVD::Constraint`(s) to denote it as being required within an `AVD::Constraints::Collection`.
# See [this][Athena::Validator::Constraints::Collection--required-and-optional-constraints] for more information.
#
# ```crystal
# ```
# class Post
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/size.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that the `#size` of a `String` or `Indexable` value is between some minimum and maximum.
#
# ```crystal
# ```
# class User
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/unique.cr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Validates that all elements of an `Indexable` are unique.
#
# ```crystal
# ```
# class School
# include AVD::Validatable
#
Expand Down
2 changes: 1 addition & 1 deletion src/components/validator/src/constraints/url.cr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# NOTE: As with most other constraints, `nil` and empty strings are considered valid values, in order to allow the value to be optional.
# If the value is required, consider combining this constraint with `AVD::Constraints::NotBlank`.
#
# ```crystal
# ```
# class Profile
# include AVD::Validatable
#
Expand Down

0 comments on commit 497f5ff

Please sign in to comment.