domainic-type 0.1.0.alpha.3.4.0 → 0.1.0.alpha.3.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/domainic/type/constraint/behavior.rb +17 -0
- data/lib/domainic/type/constraint/constraints/all_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/and_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/any_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/attribute_presence_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/case_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/character_set_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/divisibility_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/emptiness_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/equality_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/finiteness_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/inclusion_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/instance_of_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/match_pattern_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/method_presence_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/none_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/nor_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/not_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/or_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/ordering_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/parity_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/polarity_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/predicate_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/range_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/type_constraint.rb +4 -0
- data/lib/domainic/type/constraint/constraints/uniqueness_constraint.rb +4 -0
- data/lib/domainic/type/constraint/set.rb +9 -0
- data/sig/domainic/type/constraint/behavior.rbs +10 -0
- data/sig/domainic/type/constraint/constraints/all_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/and_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/any_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/attribute_presence_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/case_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/character_set_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/divisibility_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/emptiness_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/equality_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/finiteness_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/inclusion_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/instance_of_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/match_pattern_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/method_presence_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/none_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/nor_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/not_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/or_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/ordering_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/parity_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/polarity_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/predicate_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/range_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/type_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/constraints/uniqueness_constraint.rbs +4 -0
- data/sig/domainic/type/constraint/set.rbs +4 -0
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 550b1308cecd5947776940a2dcc989cdd36887d95eb465ecfc38536917ee37f8
|
4
|
+
data.tar.gz: 81b6b0cd20abc571c139b513ab1e04a85a05d986c5b382afa39335e254098cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11ffccc4e5d51bba2c827c6546e619a4ea0adacdf082e9fa400b7392acf5e5a17165c288793d0ccaa20143623e69023ca409e6138d516f5d3d14618a1ccec7f2
|
7
|
+
data.tar.gz: 5390e21417c13932df1f32da949fcf3af23ac31a56423b20cc6ec7752616a47765c867fb03d92f218d19d956a649c63027c17bdd9d98724d46a7c267b8cb1c06
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
> [!IMPORTANT]
|
9
9
|
> We're running an experiment with Domainic::Type! Help us explore flexible type validation in Ruby by trying our
|
10
|
-
> [alpha release](https://github.com/domainic/domainic/wiki/experiments-domainic-type-alpha
|
10
|
+
> [alpha release](https://github.com/domainic/domainic/wiki/experiments-domainic-type-v0.1.0-alpha). Your feedback is
|
11
11
|
> invaluable for shaping the future of domain-driven design in Ruby.
|
12
12
|
|
13
13
|
A flexible type validation system for Ruby that brings the power of composable constraints and crystal-clear error
|
@@ -53,6 +53,9 @@ module Domainic
|
|
53
53
|
# @rbs!
|
54
54
|
# type options = { ?abort_on_failure: bool, ?coerce_with: Array[Proc] | Proc }
|
55
55
|
|
56
|
+
# @rbs skip
|
57
|
+
extend Gem::Deprecate
|
58
|
+
|
56
59
|
# @rbs @accessor: Type::accessor
|
57
60
|
# @rbs @actual: Actual
|
58
61
|
# @rbs @expected: Expected
|
@@ -120,19 +123,25 @@ module Domainic
|
|
120
123
|
|
121
124
|
# The full description of the constraint.
|
122
125
|
#
|
126
|
+
# @deprecated this method will be removed in version 0.1.0
|
127
|
+
#
|
123
128
|
# @return [String, nil] The full description of the constraint.
|
124
129
|
# @rbs () -> String?
|
125
130
|
def full_description
|
126
131
|
full_description_for(short_description)
|
127
132
|
end
|
133
|
+
deprecate :full_description, :none, 2025, 3 # steep:ignore
|
128
134
|
|
129
135
|
# The full description of the violations that caused the constraint to be unsatisfied.
|
130
136
|
#
|
137
|
+
# @deprecated this method will be removed in version 0.1.0
|
138
|
+
#
|
131
139
|
# @return [String, nil] The full description of the constraint when it fails.
|
132
140
|
# @rbs () -> String?
|
133
141
|
def full_violation_description
|
134
142
|
full_description_for(short_violation_description)
|
135
143
|
end
|
144
|
+
deprecate :full_violation_description, :none, 2025, 3 # steep:ignore
|
136
145
|
|
137
146
|
# Whether the constraint is satisfied.
|
138
147
|
#
|
@@ -161,22 +170,28 @@ module Domainic
|
|
161
170
|
# Implementing classes should override this to provide meaningful descriptions of their
|
162
171
|
# constraint behavior.
|
163
172
|
#
|
173
|
+
# @deprecated this method will be removed in version 0.1.0
|
174
|
+
#
|
164
175
|
# @return [String] The description of the constraint.
|
165
176
|
# @rbs () -> String
|
166
177
|
def short_description
|
167
178
|
@expected.to_s
|
168
179
|
end
|
180
|
+
deprecate :short_description, :none, 2025, 3 # steep:ignore
|
169
181
|
|
170
182
|
# The short description of the violations that caused the constraint to be unsatisfied.
|
171
183
|
#
|
172
184
|
# This is used to help compose a error message when the constraint is not satisfied.
|
173
185
|
# Implementing classes can override this to provide more specific failure messages.
|
174
186
|
#
|
187
|
+
# @deprecated this method will be removed in version 0.1.0
|
188
|
+
#
|
175
189
|
# @return [String] The description of the constraint when it fails.
|
176
190
|
# @rbs () -> String
|
177
191
|
def short_violation_description
|
178
192
|
@actual.to_s
|
179
193
|
end
|
194
|
+
deprecate :short_violation_description, :none, 2025, 3 # steep:ignore
|
180
195
|
|
181
196
|
# Whether the constraint is a success.
|
182
197
|
#
|
@@ -310,6 +325,8 @@ module Domainic
|
|
310
325
|
|
311
326
|
# Generate the full description for the corresponding short description.
|
312
327
|
#
|
328
|
+
# @deprecated this method will be removed in version 0.1.0
|
329
|
+
#
|
313
330
|
# @param description [String] The short description to expand.
|
314
331
|
#
|
315
332
|
# @return [String] The full description.
|
@@ -30,6 +30,8 @@ module Domainic
|
|
30
30
|
|
31
31
|
# Get a description of what the constraint expects.
|
32
32
|
#
|
33
|
+
# @deprecated this method will be removed in version 0.1.0
|
34
|
+
#
|
33
35
|
# @return [String] the constraint description
|
34
36
|
# @rbs override
|
35
37
|
def short_description
|
@@ -41,6 +43,8 @@ module Domainic
|
|
41
43
|
# This is used to help compose a error message when the constraint is not satisfied.
|
42
44
|
# Implementing classes can override this to provide more specific failure messages.
|
43
45
|
#
|
46
|
+
# @deprecated this method will be removed in version 0.1.0
|
47
|
+
#
|
44
48
|
# @return [String] The description of the constraint when it fails.
|
45
49
|
# @rbs override
|
46
50
|
def short_violation_description
|
@@ -33,6 +33,8 @@ module Domainic
|
|
33
33
|
|
34
34
|
# Get a description of what the constraint expects.
|
35
35
|
#
|
36
|
+
# @deprecated this method will be removed in version 0.1.0
|
37
|
+
#
|
36
38
|
# @return [String] a description combining all constraint descriptions with 'and'
|
37
39
|
# @rbs override
|
38
40
|
def short_description
|
@@ -51,6 +53,8 @@ module Domainic
|
|
51
53
|
# This method provides detailed feedback about which constraints failed,
|
52
54
|
# listing all violations that prevented validation from succeeding.
|
53
55
|
#
|
56
|
+
# @deprecated this method will be removed in version 0.1.0
|
57
|
+
#
|
54
58
|
# @return [String] The combined violation descriptions from all constraints
|
55
59
|
# @rbs override
|
56
60
|
def short_violation_description
|
@@ -32,6 +32,8 @@ module Domainic
|
|
32
32
|
|
33
33
|
# Get a description of what the constraint expects.
|
34
34
|
#
|
35
|
+
# @deprecated this method will be removed in version 0.1.0
|
36
|
+
#
|
35
37
|
# @return [String] a description combining all constraint descriptions
|
36
38
|
# @rbs override
|
37
39
|
def short_description
|
@@ -43,6 +45,8 @@ module Domainic
|
|
43
45
|
# This method provides detailed feedback when no constraints are satisfied,
|
44
46
|
# listing all the ways in which the value failed validation.
|
45
47
|
#
|
48
|
+
# @deprecated this method will be removed in version 0.1.0
|
49
|
+
#
|
46
50
|
# @return [String] The combined violation descriptions from all constraints
|
47
51
|
# @rbs override
|
48
52
|
def short_violation_description
|
@@ -50,6 +50,8 @@ module Domainic
|
|
50
50
|
|
51
51
|
# Get a description of what the constraint expects
|
52
52
|
#
|
53
|
+
# @deprecated this method will be removed in version 0.1.0
|
54
|
+
#
|
53
55
|
# @return [String] the constraint description
|
54
56
|
# @rbs override
|
55
57
|
def short_description
|
@@ -58,6 +60,8 @@ module Domainic
|
|
58
60
|
|
59
61
|
# Get a description of why the constraint was violated
|
60
62
|
#
|
63
|
+
# @deprecated this method will be removed in version 0.1.0
|
64
|
+
#
|
61
65
|
# @return [String] the violation description
|
62
66
|
# @rbs override
|
63
67
|
def short_violation_description
|
@@ -43,6 +43,8 @@ module Domainic
|
|
43
43
|
|
44
44
|
# Get a human-readable description of the case requirement.
|
45
45
|
#
|
46
|
+
# @deprecated this method will be removed in version 0.1.0
|
47
|
+
#
|
46
48
|
# @example
|
47
49
|
# constraint = CaseConstraint.new(:self, :upper)
|
48
50
|
# constraint.short_description # => "upper case"
|
@@ -55,6 +57,8 @@ module Domainic
|
|
55
57
|
|
56
58
|
# Get a human-readable description of why case validation failed.
|
57
59
|
#
|
60
|
+
# @deprecated this method will be removed in version 0.1.0
|
61
|
+
#
|
58
62
|
# @example
|
59
63
|
# constraint = CaseConstraint.new(:self, :upper)
|
60
64
|
# constraint.satisfied?("Hello")
|
@@ -51,6 +51,8 @@ module Domainic
|
|
51
51
|
|
52
52
|
# Get a human-readable description of the character set requirement.
|
53
53
|
#
|
54
|
+
# @deprecated this method will be removed in version 0.1.0
|
55
|
+
#
|
54
56
|
# @example
|
55
57
|
# constraint = CharacterSetConstraint.new(:self, :numeric)
|
56
58
|
# constraint.short_description # => "only numeric characters"
|
@@ -63,6 +65,8 @@ module Domainic
|
|
63
65
|
|
64
66
|
# Get a human-readable description of why character validation failed.
|
65
67
|
#
|
68
|
+
# @deprecated this method will be removed in version 0.1.0
|
69
|
+
#
|
66
70
|
# @example
|
67
71
|
# constraint = CharacterSetConstraint.new(:self, :numeric)
|
68
72
|
# constraint.satisfied?("abc123")
|
@@ -44,6 +44,8 @@ module Domainic
|
|
44
44
|
|
45
45
|
# Get a human-readable description of the divisibility requirement.
|
46
46
|
#
|
47
|
+
# @deprecated this method will be removed in version 0.1.0
|
48
|
+
#
|
47
49
|
# @example
|
48
50
|
# constraint = DivisibilityConstraint.new(:self, 5)
|
49
51
|
# constraint.short_description # => "divisible by 5"
|
@@ -56,6 +58,8 @@ module Domainic
|
|
56
58
|
|
57
59
|
# Get a human-readable description of why divisibility validation failed.
|
58
60
|
#
|
61
|
+
# @deprecated this method will be removed in version 0.1.0
|
62
|
+
#
|
59
63
|
# @example With non-numeric value
|
60
64
|
# constraint = DivisibilityConstraint.new(:self, 5)
|
61
65
|
# constraint.satisfied?("not a number")
|
@@ -28,6 +28,8 @@ module Domainic
|
|
28
28
|
|
29
29
|
# Get a human-readable description of the emptiness requirement.
|
30
30
|
#
|
31
|
+
# @deprecated this method will be removed in version 0.1.0
|
32
|
+
#
|
31
33
|
# @example
|
32
34
|
# constraint = EmptinessConstraint.new(:self)
|
33
35
|
# constraint.description # => "empty"
|
@@ -40,6 +42,8 @@ module Domainic
|
|
40
42
|
|
41
43
|
# Get a human-readable description of why emptiness validation failed.
|
42
44
|
#
|
45
|
+
# @deprecated this method will be removed in version 0.1.0
|
46
|
+
#
|
43
47
|
# @example
|
44
48
|
# constraint = EmptinessConstraint.new(:self)
|
45
49
|
# constraint.satisfied?([1, 2, 3])
|
@@ -34,6 +34,8 @@ module Domainic
|
|
34
34
|
|
35
35
|
# Get a human-readable description of the equality requirement.
|
36
36
|
#
|
37
|
+
# @deprecated this method will be removed in version 0.1.0
|
38
|
+
#
|
37
39
|
# @example
|
38
40
|
# constraint = EqualityConstraint.new(:self, 42)
|
39
41
|
# constraint.description # => "equal to 42"
|
@@ -46,6 +48,8 @@ module Domainic
|
|
46
48
|
|
47
49
|
# Get a human-readable description of why equality validation failed.
|
48
50
|
#
|
51
|
+
# @deprecated this method will be removed in version 0.1.0
|
52
|
+
#
|
49
53
|
# @example
|
50
54
|
# constraint = EqualityConstraint.new(:self, 42)
|
51
55
|
# constraint.satisfied?(41)
|
@@ -31,6 +31,8 @@ module Domainic
|
|
31
31
|
|
32
32
|
# Get a human-readable description of the finiteness requirement.
|
33
33
|
#
|
34
|
+
# @deprecated this method will be removed in version 0.1.0
|
35
|
+
#
|
34
36
|
# @return [String] Description of the finiteness requirement
|
35
37
|
# @rbs override
|
36
38
|
def short_description
|
@@ -39,6 +41,8 @@ module Domainic
|
|
39
41
|
|
40
42
|
# Get a human-readable description of why finiteness validation failed.
|
41
43
|
#
|
44
|
+
# @deprecated this method will be removed in version 0.1.0
|
45
|
+
#
|
42
46
|
# @return [String] Description of the validation failure
|
43
47
|
# @rbs override
|
44
48
|
def short_violation_description
|
@@ -33,6 +33,8 @@ module Domainic
|
|
33
33
|
|
34
34
|
# Get a human-readable description of the inclusion requirement.
|
35
35
|
#
|
36
|
+
# @deprecated this method will be removed in version 0.1.0
|
37
|
+
#
|
36
38
|
# @example
|
37
39
|
# constraint = InclusionConstraint.new(:self, 42)
|
38
40
|
# constraint.short_description # => "including 42"
|
@@ -45,6 +47,8 @@ module Domainic
|
|
45
47
|
|
46
48
|
# Get a human-readable description of why inclusion validation failed.
|
47
49
|
#
|
50
|
+
# @deprecated this method will be removed in version 0.1.0
|
51
|
+
#
|
48
52
|
# @example
|
49
53
|
# constraint = InclusionConstraint.new(:self, 42)
|
50
54
|
# constraint.satisfied?([1, 2, 3])
|
@@ -28,6 +28,8 @@ module Domainic
|
|
28
28
|
|
29
29
|
# Get a human-readable description of the instance requirement.
|
30
30
|
#
|
31
|
+
# @deprecated this method will be removed in version 0.1.0
|
32
|
+
#
|
31
33
|
# @example
|
32
34
|
# constraint = InstanceOfConstraint.new(:self, String)
|
33
35
|
# constraint.description # => "instance of String"
|
@@ -40,6 +42,8 @@ module Domainic
|
|
40
42
|
|
41
43
|
# Get a human-readable description of why instance validation failed.
|
42
44
|
#
|
45
|
+
# @deprecated this method will be removed in version 0.1.0
|
46
|
+
#
|
43
47
|
# @example
|
44
48
|
# constraint = InstanceOfConstraint.new(:self, String)
|
45
49
|
# constraint.satisfied?(:symbol)
|
@@ -28,6 +28,8 @@ module Domainic
|
|
28
28
|
|
29
29
|
# Get a human-readable description of the pattern requirement.
|
30
30
|
#
|
31
|
+
# @deprecated this method will be removed in version 0.1.0
|
32
|
+
#
|
31
33
|
# @example
|
32
34
|
# constraint = MatchPatternConstraint.new(:self, /\d+/)
|
33
35
|
# constraint.short_description # => "matches /\\d+/"
|
@@ -40,6 +42,8 @@ module Domainic
|
|
40
42
|
|
41
43
|
# Get a human-readable description of why pattern validation failed.
|
42
44
|
#
|
45
|
+
# @deprecated this method will be removed in version 0.1.0
|
46
|
+
#
|
43
47
|
# @example
|
44
48
|
# constraint = MatchPatternConstraint.new(:self, /\d+/)
|
45
49
|
# constraint.satisfied?("abc")
|
@@ -22,6 +22,8 @@ module Domainic
|
|
22
22
|
|
23
23
|
# Get a short description of what this constraint expects
|
24
24
|
#
|
25
|
+
# @deprecated this method will be removed in version 0.1.0
|
26
|
+
#
|
25
27
|
# @return [String] description of the expected method
|
26
28
|
# @rbs override
|
27
29
|
def short_description
|
@@ -30,6 +32,8 @@ module Domainic
|
|
30
32
|
|
31
33
|
# Get a short description of why the constraint was violated
|
32
34
|
#
|
35
|
+
# @deprecated this method will be removed in version 0.1.0
|
36
|
+
#
|
33
37
|
# @return [String] description of the missing method
|
34
38
|
# @rbs override
|
35
39
|
def short_violation_description
|
@@ -32,6 +32,8 @@ module Domainic
|
|
32
32
|
|
33
33
|
# Get a description of what the constraint expects.
|
34
34
|
#
|
35
|
+
# @deprecated this method will be removed in version 0.1.0
|
36
|
+
#
|
35
37
|
# @return [String] a description negating the expected constraint description
|
36
38
|
# @rbs override
|
37
39
|
def short_description
|
@@ -43,6 +45,8 @@ module Domainic
|
|
43
45
|
# This method provides detailed feedback when any constraints are satisfied,
|
44
46
|
# listing all the ways in which the value failed validation.
|
45
47
|
#
|
48
|
+
# @deprecated this method will be removed in version 0.1.0
|
49
|
+
#
|
46
50
|
# @return [String] The combined violation descriptions from all violating elements
|
47
51
|
# @rbs override
|
48
52
|
def short_violation_description
|
@@ -35,6 +35,8 @@ module Domainic
|
|
35
35
|
|
36
36
|
# Get a description of what the constraint expects.
|
37
37
|
#
|
38
|
+
# @deprecated this method will be removed in version 0.1.0
|
39
|
+
#
|
38
40
|
# @return [String] a description combining all constraint descriptions with 'nor'
|
39
41
|
# @rbs override
|
40
42
|
def short_description
|
@@ -50,6 +52,8 @@ module Domainic
|
|
50
52
|
# This method provides detailed feedback about which constraints were satisfied,
|
51
53
|
# listing all violations that caused the validation to fail.
|
52
54
|
#
|
55
|
+
# @deprecated this method will be removed in version 0.1.0
|
56
|
+
#
|
53
57
|
# @return [String] The combined violation descriptions from all satisfied constraints
|
54
58
|
# @rbs override
|
55
59
|
def short_violation_description
|
@@ -31,6 +31,8 @@ module Domainic
|
|
31
31
|
|
32
32
|
# Get a description of what the constraint expects.
|
33
33
|
#
|
34
|
+
# @deprecated this method will be removed in version 0.1.0
|
35
|
+
#
|
34
36
|
# @return [String] the negated constraint description
|
35
37
|
# @rbs override
|
36
38
|
def short_description
|
@@ -42,6 +44,8 @@ module Domainic
|
|
42
44
|
# This is used to help compose a error message when the constraint is not satisfied.
|
43
45
|
# Implementing classes can override this to provide more specific failure messages.
|
44
46
|
#
|
47
|
+
# @deprecated this method will be removed in version 0.1.0
|
48
|
+
#
|
45
49
|
# @return [String] The description of the constraint when it fails.
|
46
50
|
# @rbs override
|
47
51
|
def short_violation_description
|
@@ -33,6 +33,8 @@ module Domainic
|
|
33
33
|
|
34
34
|
# Get a description of what the constraint expects.
|
35
35
|
#
|
36
|
+
# @deprecated this method will be removed in version 0.1.0
|
37
|
+
#
|
36
38
|
# @return [String] a description combining all constraint descriptions with 'or'
|
37
39
|
# @rbs override
|
38
40
|
def short_description
|
@@ -47,6 +49,8 @@ module Domainic
|
|
47
49
|
|
48
50
|
# The description of the violations that caused the constraint to be unsatisfied.
|
49
51
|
#
|
52
|
+
# @deprecated this method will be removed in version 0.1.0
|
53
|
+
#
|
50
54
|
# This method provides detailed feedback when no constraints are satisfied,
|
51
55
|
# listing all the ways in which the value failed validation. Uses 'and' in the
|
52
56
|
# message because all constraints failed (e.g., "was not a string AND was not a
|
@@ -34,6 +34,8 @@ module Domainic
|
|
34
34
|
|
35
35
|
# Get a human-readable description of the ordering requirement.
|
36
36
|
#
|
37
|
+
# @deprecated this method will be removed in version 0.1.0
|
38
|
+
#
|
37
39
|
# @example
|
38
40
|
# constraint = OrderingConstraint.new(:self)
|
39
41
|
# constraint.description # => "ordered"
|
@@ -46,6 +48,8 @@ module Domainic
|
|
46
48
|
|
47
49
|
# Get a human-readable description of why ordering validation failed.
|
48
50
|
#
|
51
|
+
# @deprecated this method will be removed in version 0.1.0
|
52
|
+
#
|
49
53
|
# @example
|
50
54
|
# constraint = OrderingConstraint.new(:self)
|
51
55
|
# constraint.satisfied?([3, 1, 2])
|
@@ -27,6 +27,8 @@ module Domainic
|
|
27
27
|
|
28
28
|
# Get a human-readable description of the parity requirement.
|
29
29
|
#
|
30
|
+
# @deprecated this method will be removed in version 0.1.0
|
31
|
+
#
|
30
32
|
# @example
|
31
33
|
# constraint = ParityConstraint.new(:self).expecting(:even)
|
32
34
|
# constraint.short_description # => "even"
|
@@ -39,6 +41,8 @@ module Domainic
|
|
39
41
|
|
40
42
|
# Get a human-readable description of why parity validation failed.
|
41
43
|
#
|
44
|
+
# @deprecated this method will be removed in version 0.1.0
|
45
|
+
#
|
42
46
|
# @example
|
43
47
|
# constraint = ParityConstraint.new(:self).expecting(:positive)
|
44
48
|
# constraint.satisfied?(0)
|
@@ -37,6 +37,8 @@ module Domainic
|
|
37
37
|
|
38
38
|
# Get a human-readable description of the polarity requirement.
|
39
39
|
#
|
40
|
+
# @deprecated this method will be removed in version 0.1.0
|
41
|
+
#
|
40
42
|
# @example
|
41
43
|
# constraint = PolarityConstraint.new(:self).expecting(:positive)
|
42
44
|
# constraint.short_description # => "positive"
|
@@ -49,6 +51,8 @@ module Domainic
|
|
49
51
|
|
50
52
|
# Get a human-readable description of why polarity validation failed.
|
51
53
|
#
|
54
|
+
# @deprecated this method will be removed in version 0.1.0
|
55
|
+
#
|
52
56
|
# @example
|
53
57
|
# constraint = PolarityConstraint.new(:self).expecting(:positive)
|
54
58
|
# constraint.satisfied?(0)
|
@@ -33,6 +33,8 @@ module Domainic
|
|
33
33
|
|
34
34
|
# Get a description of what the constraint expects.
|
35
35
|
#
|
36
|
+
# @deprecated this method will be removed in version 0.1.0
|
37
|
+
#
|
36
38
|
# @note This constraint type does not provide a description as predicates are arbitrary.
|
37
39
|
#
|
38
40
|
# @return [String] an empty string
|
@@ -41,6 +43,8 @@ module Domainic
|
|
41
43
|
|
42
44
|
# Get a description of why the predicate validation failed.
|
43
45
|
#
|
46
|
+
# @deprecated this method will be removed in version 0.1.0
|
47
|
+
#
|
44
48
|
# @return [String] the custom violation description if provided
|
45
49
|
# @rbs override
|
46
50
|
def short_violation_description
|
@@ -58,6 +58,8 @@ module Domainic
|
|
58
58
|
|
59
59
|
# Get a human-readable description of the range constraint.
|
60
60
|
#
|
61
|
+
# @deprecated this method will be removed in version 0.1.0
|
62
|
+
#
|
61
63
|
# @example With both bounds
|
62
64
|
# constraint = RangeConstraint.new(:self, { minimum: 1, maximum: 10 })
|
63
65
|
# constraint.description
|
@@ -86,6 +88,8 @@ module Domainic
|
|
86
88
|
|
87
89
|
# The description of the violations that caused the constraint to be unsatisfied.
|
88
90
|
#
|
91
|
+
# @deprecated this method will be removed in version 0.1.0
|
92
|
+
#
|
89
93
|
# This is used to help compose a error message when the constraint is not satisfied.
|
90
94
|
# Implementing classes can override this to provide more specific failure messages.
|
91
95
|
#
|
@@ -45,6 +45,8 @@ module Domainic
|
|
45
45
|
|
46
46
|
# Get a human-readable description of the expected type.
|
47
47
|
#
|
48
|
+
# @deprecated this method will be removed in version 0.1.0
|
49
|
+
#
|
48
50
|
# @example
|
49
51
|
# constraint = TypeConstraint.new(:self, Float)
|
50
52
|
# constraint.description # => "Float"
|
@@ -63,6 +65,8 @@ module Domainic
|
|
63
65
|
# This is used to help compose a error message when the constraint is not satisfied.
|
64
66
|
# Implementing classes can override this to provide more specific failure messages.
|
65
67
|
#
|
68
|
+
# @deprecated this method will be removed in version 0.1.0
|
69
|
+
#
|
66
70
|
# @return [String] The description of the constraint when it fails.
|
67
71
|
# @rbs override
|
68
72
|
def short_violation_description
|
@@ -29,6 +29,8 @@ module Domainic
|
|
29
29
|
|
30
30
|
# Get a human-readable description of the uniqueness requirement.
|
31
31
|
#
|
32
|
+
# @deprecated this method will be removed in version 0.1.0
|
33
|
+
#
|
32
34
|
# @example
|
33
35
|
# constraint = UniquenessConstraint.new(:self)
|
34
36
|
# constraint.description # => "unique"
|
@@ -44,6 +46,8 @@ module Domainic
|
|
44
46
|
# This is used to help compose a error message when the constraint is not satisfied.
|
45
47
|
# Implementing classes can override this to provide more specific failure messages.
|
46
48
|
#
|
49
|
+
# @deprecated this method will be removed in version 0.1.0
|
50
|
+
#
|
47
51
|
# @return [String] The description of the constraint when it fails.
|
48
52
|
# @rbs override
|
49
53
|
def short_violation_description
|
@@ -34,6 +34,9 @@ module Domainic
|
|
34
34
|
class Set
|
35
35
|
extend Forwardable
|
36
36
|
|
37
|
+
# @rbs skip
|
38
|
+
extend Gem::Deprecate
|
39
|
+
|
37
40
|
# @rbs @lookup: Hash[Type::accessor, Hash[Symbol, Behavior]]
|
38
41
|
|
39
42
|
# Initialize a new empty constraint set.
|
@@ -121,6 +124,8 @@ module Domainic
|
|
121
124
|
|
122
125
|
# The aggregate description of all constraints in the set.
|
123
126
|
#
|
127
|
+
# @deprecated this method will be removed in version 0.1.0
|
128
|
+
#
|
124
129
|
# @return [String] The description of all constraints
|
125
130
|
# @rbs () -> String
|
126
131
|
def description
|
@@ -128,6 +133,7 @@ module Domainic
|
|
128
133
|
@lookup[accessor].values.filter_map(&:full_description)
|
129
134
|
end.join(', ').strip
|
130
135
|
end
|
136
|
+
deprecate :description, :none, 2025, 3 # steep:ignore
|
131
137
|
|
132
138
|
# @!method each
|
133
139
|
# Iterate over each constraint in the set.
|
@@ -221,6 +227,8 @@ module Domainic
|
|
221
227
|
|
222
228
|
# The aggregate violation description of all constraints in the set.
|
223
229
|
#
|
230
|
+
# @deprecated this method will be removed in version 0.1.0
|
231
|
+
#
|
224
232
|
# @return [String] The description of all constraints
|
225
233
|
# @rbs () -> String
|
226
234
|
def violation_description
|
@@ -228,6 +236,7 @@ module Domainic
|
|
228
236
|
@lookup[accessor].values.reject(&:successful?).filter_map(&:full_violation_description)
|
229
237
|
end.join(', ').strip
|
230
238
|
end
|
239
|
+
deprecate :violation_description, :none, 2025, 3 # steep:ignore
|
231
240
|
|
232
241
|
private
|
233
242
|
|
@@ -97,11 +97,15 @@ module Domainic
|
|
97
97
|
|
98
98
|
# The full description of the constraint.
|
99
99
|
#
|
100
|
+
# @deprecated this method will be removed in version 0.1.0
|
101
|
+
#
|
100
102
|
# @return [String, nil] The full description of the constraint.
|
101
103
|
def full_description: () -> String?
|
102
104
|
|
103
105
|
# The full description of the violations that caused the constraint to be unsatisfied.
|
104
106
|
#
|
107
|
+
# @deprecated this method will be removed in version 0.1.0
|
108
|
+
#
|
105
109
|
# @return [String, nil] The full description of the constraint when it fails.
|
106
110
|
def full_violation_description: () -> String?
|
107
111
|
|
@@ -124,6 +128,8 @@ module Domainic
|
|
124
128
|
# Implementing classes should override this to provide meaningful descriptions of their
|
125
129
|
# constraint behavior.
|
126
130
|
#
|
131
|
+
# @deprecated this method will be removed in version 0.1.0
|
132
|
+
#
|
127
133
|
# @return [String] The description of the constraint.
|
128
134
|
def short_description: () -> String
|
129
135
|
|
@@ -132,6 +138,8 @@ module Domainic
|
|
132
138
|
# This is used to help compose a error message when the constraint is not satisfied.
|
133
139
|
# Implementing classes can override this to provide more specific failure messages.
|
134
140
|
#
|
141
|
+
# @deprecated this method will be removed in version 0.1.0
|
142
|
+
#
|
135
143
|
# @return [String] The description of the constraint when it fails.
|
136
144
|
def short_violation_description: () -> String
|
137
145
|
|
@@ -240,6 +248,8 @@ module Domainic
|
|
240
248
|
|
241
249
|
# Generate the full description for the corresponding short description.
|
242
250
|
#
|
251
|
+
# @deprecated this method will be removed in version 0.1.0
|
252
|
+
#
|
243
253
|
# @param description [String] The short description to expand.
|
244
254
|
#
|
245
255
|
# @return [String] The full description.
|
@@ -26,6 +26,8 @@ module Domainic
|
|
26
26
|
|
27
27
|
# Get a description of what the constraint expects.
|
28
28
|
#
|
29
|
+
# @deprecated this method will be removed in version 0.1.0
|
30
|
+
#
|
29
31
|
# @return [String] the constraint description
|
30
32
|
def short_description: ...
|
31
33
|
|
@@ -34,6 +36,8 @@ module Domainic
|
|
34
36
|
# This is used to help compose a error message when the constraint is not satisfied.
|
35
37
|
# Implementing classes can override this to provide more specific failure messages.
|
36
38
|
#
|
39
|
+
# @deprecated this method will be removed in version 0.1.0
|
40
|
+
#
|
37
41
|
# @return [String] The description of the constraint when it fails.
|
38
42
|
def short_violation_description: ...
|
39
43
|
|
@@ -29,6 +29,8 @@ module Domainic
|
|
29
29
|
|
30
30
|
# Get a description of what the constraint expects.
|
31
31
|
#
|
32
|
+
# @deprecated this method will be removed in version 0.1.0
|
33
|
+
#
|
32
34
|
# @return [String] a description combining all constraint descriptions with 'and'
|
33
35
|
def short_description: ...
|
34
36
|
|
@@ -39,6 +41,8 @@ module Domainic
|
|
39
41
|
# This method provides detailed feedback about which constraints failed,
|
40
42
|
# listing all violations that prevented validation from succeeding.
|
41
43
|
#
|
44
|
+
# @deprecated this method will be removed in version 0.1.0
|
45
|
+
#
|
42
46
|
# @return [String] The combined violation descriptions from all constraints
|
43
47
|
def short_violation_description: ...
|
44
48
|
|
@@ -28,6 +28,8 @@ module Domainic
|
|
28
28
|
|
29
29
|
# Get a description of what the constraint expects.
|
30
30
|
#
|
31
|
+
# @deprecated this method will be removed in version 0.1.0
|
32
|
+
#
|
31
33
|
# @return [String] a description combining all constraint descriptions
|
32
34
|
def short_description: ...
|
33
35
|
|
@@ -36,6 +38,8 @@ module Domainic
|
|
36
38
|
# This method provides detailed feedback when no constraints are satisfied,
|
37
39
|
# listing all the ways in which the value failed validation.
|
38
40
|
#
|
41
|
+
# @deprecated this method will be removed in version 0.1.0
|
42
|
+
#
|
39
43
|
# @return [String] The combined violation descriptions from all constraints
|
40
44
|
def short_violation_description: ...
|
41
45
|
|
@@ -45,11 +45,15 @@ module Domainic
|
|
45
45
|
|
46
46
|
# Get a description of what the constraint expects
|
47
47
|
#
|
48
|
+
# @deprecated this method will be removed in version 0.1.0
|
49
|
+
#
|
48
50
|
# @return [String] the constraint description
|
49
51
|
def short_description: ...
|
50
52
|
|
51
53
|
# Get a description of why the constraint was violated
|
52
54
|
#
|
55
|
+
# @deprecated this method will be removed in version 0.1.0
|
56
|
+
#
|
53
57
|
# @return [String] the violation description
|
54
58
|
def short_violation_description: ...
|
55
59
|
|
@@ -38,6 +38,8 @@ module Domainic
|
|
38
38
|
|
39
39
|
# Get a human-readable description of the case requirement.
|
40
40
|
#
|
41
|
+
# @deprecated this method will be removed in version 0.1.0
|
42
|
+
#
|
41
43
|
# @example
|
42
44
|
# constraint = CaseConstraint.new(:self, :upper)
|
43
45
|
# constraint.short_description # => "upper case"
|
@@ -47,6 +49,8 @@ module Domainic
|
|
47
49
|
|
48
50
|
# Get a human-readable description of why case validation failed.
|
49
51
|
#
|
52
|
+
# @deprecated this method will be removed in version 0.1.0
|
53
|
+
#
|
50
54
|
# @example
|
51
55
|
# constraint = CaseConstraint.new(:self, :upper)
|
52
56
|
# constraint.satisfied?("Hello")
|
@@ -40,6 +40,8 @@ module Domainic
|
|
40
40
|
|
41
41
|
# Get a human-readable description of the character set requirement.
|
42
42
|
#
|
43
|
+
# @deprecated this method will be removed in version 0.1.0
|
44
|
+
#
|
43
45
|
# @example
|
44
46
|
# constraint = CharacterSetConstraint.new(:self, :numeric)
|
45
47
|
# constraint.short_description # => "only numeric characters"
|
@@ -49,6 +51,8 @@ module Domainic
|
|
49
51
|
|
50
52
|
# Get a human-readable description of why character validation failed.
|
51
53
|
#
|
54
|
+
# @deprecated this method will be removed in version 0.1.0
|
55
|
+
#
|
52
56
|
# @example
|
53
57
|
# constraint = CharacterSetConstraint.new(:self, :numeric)
|
54
58
|
# constraint.satisfied?("abc123")
|
@@ -39,6 +39,8 @@ module Domainic
|
|
39
39
|
|
40
40
|
# Get a human-readable description of the divisibility requirement.
|
41
41
|
#
|
42
|
+
# @deprecated this method will be removed in version 0.1.0
|
43
|
+
#
|
42
44
|
# @example
|
43
45
|
# constraint = DivisibilityConstraint.new(:self, 5)
|
44
46
|
# constraint.short_description # => "divisible by 5"
|
@@ -48,6 +50,8 @@ module Domainic
|
|
48
50
|
|
49
51
|
# Get a human-readable description of why divisibility validation failed.
|
50
52
|
#
|
53
|
+
# @deprecated this method will be removed in version 0.1.0
|
54
|
+
#
|
51
55
|
# @example With non-numeric value
|
52
56
|
# constraint = DivisibilityConstraint.new(:self, 5)
|
53
57
|
# constraint.satisfied?("not a number")
|
@@ -24,6 +24,8 @@ module Domainic
|
|
24
24
|
|
25
25
|
# Get a human-readable description of the emptiness requirement.
|
26
26
|
#
|
27
|
+
# @deprecated this method will be removed in version 0.1.0
|
28
|
+
#
|
27
29
|
# @example
|
28
30
|
# constraint = EmptinessConstraint.new(:self)
|
29
31
|
# constraint.description # => "empty"
|
@@ -33,6 +35,8 @@ module Domainic
|
|
33
35
|
|
34
36
|
# Get a human-readable description of why emptiness validation failed.
|
35
37
|
#
|
38
|
+
# @deprecated this method will be removed in version 0.1.0
|
39
|
+
#
|
36
40
|
# @example
|
37
41
|
# constraint = EmptinessConstraint.new(:self)
|
38
42
|
# constraint.satisfied?([1, 2, 3])
|
@@ -30,6 +30,8 @@ module Domainic
|
|
30
30
|
|
31
31
|
# Get a human-readable description of the equality requirement.
|
32
32
|
#
|
33
|
+
# @deprecated this method will be removed in version 0.1.0
|
34
|
+
#
|
33
35
|
# @example
|
34
36
|
# constraint = EqualityConstraint.new(:self, 42)
|
35
37
|
# constraint.description # => "equal to 42"
|
@@ -39,6 +41,8 @@ module Domainic
|
|
39
41
|
|
40
42
|
# Get a human-readable description of why equality validation failed.
|
41
43
|
#
|
44
|
+
# @deprecated this method will be removed in version 0.1.0
|
45
|
+
#
|
42
46
|
# @example
|
43
47
|
# constraint = EqualityConstraint.new(:self, 42)
|
44
48
|
# constraint.satisfied?(41)
|
@@ -26,11 +26,15 @@ module Domainic
|
|
26
26
|
|
27
27
|
# Get a human-readable description of the finiteness requirement.
|
28
28
|
#
|
29
|
+
# @deprecated this method will be removed in version 0.1.0
|
30
|
+
#
|
29
31
|
# @return [String] Description of the finiteness requirement
|
30
32
|
def short_description: ...
|
31
33
|
|
32
34
|
# Get a human-readable description of why finiteness validation failed.
|
33
35
|
#
|
36
|
+
# @deprecated this method will be removed in version 0.1.0
|
37
|
+
#
|
34
38
|
# @return [String] Description of the validation failure
|
35
39
|
def short_violation_description: ...
|
36
40
|
|
@@ -29,6 +29,8 @@ module Domainic
|
|
29
29
|
|
30
30
|
# Get a human-readable description of the inclusion requirement.
|
31
31
|
#
|
32
|
+
# @deprecated this method will be removed in version 0.1.0
|
33
|
+
#
|
32
34
|
# @example
|
33
35
|
# constraint = InclusionConstraint.new(:self, 42)
|
34
36
|
# constraint.short_description # => "including 42"
|
@@ -38,6 +40,8 @@ module Domainic
|
|
38
40
|
|
39
41
|
# Get a human-readable description of why inclusion validation failed.
|
40
42
|
#
|
43
|
+
# @deprecated this method will be removed in version 0.1.0
|
44
|
+
#
|
41
45
|
# @example
|
42
46
|
# constraint = InclusionConstraint.new(:self, 42)
|
43
47
|
# constraint.satisfied?([1, 2, 3])
|
@@ -24,6 +24,8 @@ module Domainic
|
|
24
24
|
|
25
25
|
# Get a human-readable description of the instance requirement.
|
26
26
|
#
|
27
|
+
# @deprecated this method will be removed in version 0.1.0
|
28
|
+
#
|
27
29
|
# @example
|
28
30
|
# constraint = InstanceOfConstraint.new(:self, String)
|
29
31
|
# constraint.description # => "instance of String"
|
@@ -33,6 +35,8 @@ module Domainic
|
|
33
35
|
|
34
36
|
# Get a human-readable description of why instance validation failed.
|
35
37
|
#
|
38
|
+
# @deprecated this method will be removed in version 0.1.0
|
39
|
+
#
|
36
40
|
# @example
|
37
41
|
# constraint = InstanceOfConstraint.new(:self, String)
|
38
42
|
# constraint.satisfied?(:symbol)
|
@@ -24,6 +24,8 @@ module Domainic
|
|
24
24
|
|
25
25
|
# Get a human-readable description of the pattern requirement.
|
26
26
|
#
|
27
|
+
# @deprecated this method will be removed in version 0.1.0
|
28
|
+
#
|
27
29
|
# @example
|
28
30
|
# constraint = MatchPatternConstraint.new(:self, /\d+/)
|
29
31
|
# constraint.short_description # => "matches /\\d+/"
|
@@ -33,6 +35,8 @@ module Domainic
|
|
33
35
|
|
34
36
|
# Get a human-readable description of why pattern validation failed.
|
35
37
|
#
|
38
|
+
# @deprecated this method will be removed in version 0.1.0
|
39
|
+
#
|
36
40
|
# @example
|
37
41
|
# constraint = MatchPatternConstraint.new(:self, /\d+/)
|
38
42
|
# constraint.satisfied?("abc")
|
@@ -18,11 +18,15 @@ module Domainic
|
|
18
18
|
|
19
19
|
# Get a short description of what this constraint expects
|
20
20
|
#
|
21
|
+
# @deprecated this method will be removed in version 0.1.0
|
22
|
+
#
|
21
23
|
# @return [String] description of the expected method
|
22
24
|
def short_description: ...
|
23
25
|
|
24
26
|
# Get a short description of why the constraint was violated
|
25
27
|
#
|
28
|
+
# @deprecated this method will be removed in version 0.1.0
|
29
|
+
#
|
26
30
|
# @return [String] description of the missing method
|
27
31
|
def short_violation_description: ...
|
28
32
|
|
@@ -28,6 +28,8 @@ module Domainic
|
|
28
28
|
|
29
29
|
# Get a description of what the constraint expects.
|
30
30
|
#
|
31
|
+
# @deprecated this method will be removed in version 0.1.0
|
32
|
+
#
|
31
33
|
# @return [String] a description negating the expected constraint description
|
32
34
|
def short_description: ...
|
33
35
|
|
@@ -36,6 +38,8 @@ module Domainic
|
|
36
38
|
# This method provides detailed feedback when any constraints are satisfied,
|
37
39
|
# listing all the ways in which the value failed validation.
|
38
40
|
#
|
41
|
+
# @deprecated this method will be removed in version 0.1.0
|
42
|
+
#
|
39
43
|
# @return [String] The combined violation descriptions from all violating elements
|
40
44
|
def short_violation_description: ...
|
41
45
|
|
@@ -31,6 +31,8 @@ module Domainic
|
|
31
31
|
|
32
32
|
# Get a description of what the constraint expects.
|
33
33
|
#
|
34
|
+
# @deprecated this method will be removed in version 0.1.0
|
35
|
+
#
|
34
36
|
# @return [String] a description combining all constraint descriptions with 'nor'
|
35
37
|
def short_description: ...
|
36
38
|
|
@@ -39,6 +41,8 @@ module Domainic
|
|
39
41
|
# This method provides detailed feedback about which constraints were satisfied,
|
40
42
|
# listing all violations that caused the validation to fail.
|
41
43
|
#
|
44
|
+
# @deprecated this method will be removed in version 0.1.0
|
45
|
+
#
|
42
46
|
# @return [String] The combined violation descriptions from all satisfied constraints
|
43
47
|
def short_violation_description: ...
|
44
48
|
|
@@ -27,6 +27,8 @@ module Domainic
|
|
27
27
|
|
28
28
|
# Get a description of what the constraint expects.
|
29
29
|
#
|
30
|
+
# @deprecated this method will be removed in version 0.1.0
|
31
|
+
#
|
30
32
|
# @return [String] the negated constraint description
|
31
33
|
def short_description: ...
|
32
34
|
|
@@ -35,6 +37,8 @@ module Domainic
|
|
35
37
|
# This is used to help compose a error message when the constraint is not satisfied.
|
36
38
|
# Implementing classes can override this to provide more specific failure messages.
|
37
39
|
#
|
40
|
+
# @deprecated this method will be removed in version 0.1.0
|
41
|
+
#
|
38
42
|
# @return [String] The description of the constraint when it fails.
|
39
43
|
def short_violation_description: ...
|
40
44
|
|
@@ -29,6 +29,8 @@ module Domainic
|
|
29
29
|
|
30
30
|
# Get a description of what the constraint expects.
|
31
31
|
#
|
32
|
+
# @deprecated this method will be removed in version 0.1.0
|
33
|
+
#
|
32
34
|
# @return [String] a description combining all constraint descriptions with 'or'
|
33
35
|
def short_description: ...
|
34
36
|
|
@@ -36,6 +38,8 @@ module Domainic
|
|
36
38
|
|
37
39
|
# The description of the violations that caused the constraint to be unsatisfied.
|
38
40
|
#
|
41
|
+
# @deprecated this method will be removed in version 0.1.0
|
42
|
+
#
|
39
43
|
# This method provides detailed feedback when no constraints are satisfied,
|
40
44
|
# listing all the ways in which the value failed validation. Uses 'and' in the
|
41
45
|
# message because all constraints failed (e.g., "was not a string AND was not a
|
@@ -30,6 +30,8 @@ module Domainic
|
|
30
30
|
|
31
31
|
# Get a human-readable description of the ordering requirement.
|
32
32
|
#
|
33
|
+
# @deprecated this method will be removed in version 0.1.0
|
34
|
+
#
|
33
35
|
# @example
|
34
36
|
# constraint = OrderingConstraint.new(:self)
|
35
37
|
# constraint.description # => "ordered"
|
@@ -39,6 +41,8 @@ module Domainic
|
|
39
41
|
|
40
42
|
# Get a human-readable description of why ordering validation failed.
|
41
43
|
#
|
44
|
+
# @deprecated this method will be removed in version 0.1.0
|
45
|
+
#
|
42
46
|
# @example
|
43
47
|
# constraint = OrderingConstraint.new(:self)
|
44
48
|
# constraint.satisfied?([3, 1, 2])
|
@@ -22,6 +22,8 @@ module Domainic
|
|
22
22
|
|
23
23
|
# Get a human-readable description of the parity requirement.
|
24
24
|
#
|
25
|
+
# @deprecated this method will be removed in version 0.1.0
|
26
|
+
#
|
25
27
|
# @example
|
26
28
|
# constraint = ParityConstraint.new(:self).expecting(:even)
|
27
29
|
# constraint.short_description # => "even"
|
@@ -31,6 +33,8 @@ module Domainic
|
|
31
33
|
|
32
34
|
# Get a human-readable description of why parity validation failed.
|
33
35
|
#
|
36
|
+
# @deprecated this method will be removed in version 0.1.0
|
37
|
+
#
|
34
38
|
# @example
|
35
39
|
# constraint = ParityConstraint.new(:self).expecting(:positive)
|
36
40
|
# constraint.satisfied?(0)
|
@@ -32,6 +32,8 @@ module Domainic
|
|
32
32
|
|
33
33
|
# Get a human-readable description of the polarity requirement.
|
34
34
|
#
|
35
|
+
# @deprecated this method will be removed in version 0.1.0
|
36
|
+
#
|
35
37
|
# @example
|
36
38
|
# constraint = PolarityConstraint.new(:self).expecting(:positive)
|
37
39
|
# constraint.short_description # => "positive"
|
@@ -41,6 +43,8 @@ module Domainic
|
|
41
43
|
|
42
44
|
# Get a human-readable description of why polarity validation failed.
|
43
45
|
#
|
46
|
+
# @deprecated this method will be removed in version 0.1.0
|
47
|
+
#
|
44
48
|
# @example
|
45
49
|
# constraint = PolarityConstraint.new(:self).expecting(:positive)
|
46
50
|
# constraint.satisfied?(0)
|
@@ -28,6 +28,8 @@ module Domainic
|
|
28
28
|
|
29
29
|
# Get a description of what the constraint expects.
|
30
30
|
#
|
31
|
+
# @deprecated this method will be removed in version 0.1.0
|
32
|
+
#
|
31
33
|
# @note This constraint type does not provide a description as predicates are arbitrary.
|
32
34
|
#
|
33
35
|
# @return [String] an empty string
|
@@ -35,6 +37,8 @@ module Domainic
|
|
35
37
|
|
36
38
|
# Get a description of why the predicate validation failed.
|
37
39
|
#
|
40
|
+
# @deprecated this method will be removed in version 0.1.0
|
41
|
+
#
|
38
42
|
# @return [String] the custom violation description if provided
|
39
43
|
def short_violation_description: ...
|
40
44
|
|
@@ -53,6 +53,8 @@ module Domainic
|
|
53
53
|
|
54
54
|
# Get a human-readable description of the range constraint.
|
55
55
|
#
|
56
|
+
# @deprecated this method will be removed in version 0.1.0
|
57
|
+
#
|
56
58
|
# @example With both bounds
|
57
59
|
# constraint = RangeConstraint.new(:self, { minimum: 1, maximum: 10 })
|
58
60
|
# constraint.description
|
@@ -71,6 +73,8 @@ module Domainic
|
|
71
73
|
|
72
74
|
# The description of the violations that caused the constraint to be unsatisfied.
|
73
75
|
#
|
76
|
+
# @deprecated this method will be removed in version 0.1.0
|
77
|
+
#
|
74
78
|
# This is used to help compose a error message when the constraint is not satisfied.
|
75
79
|
# Implementing classes can override this to provide more specific failure messages.
|
76
80
|
#
|
@@ -40,6 +40,8 @@ module Domainic
|
|
40
40
|
|
41
41
|
# Get a human-readable description of the expected type.
|
42
42
|
#
|
43
|
+
# @deprecated this method will be removed in version 0.1.0
|
44
|
+
#
|
43
45
|
# @example
|
44
46
|
# constraint = TypeConstraint.new(:self, Float)
|
45
47
|
# constraint.description # => "Float"
|
@@ -55,6 +57,8 @@ module Domainic
|
|
55
57
|
# This is used to help compose a error message when the constraint is not satisfied.
|
56
58
|
# Implementing classes can override this to provide more specific failure messages.
|
57
59
|
#
|
60
|
+
# @deprecated this method will be removed in version 0.1.0
|
61
|
+
#
|
58
62
|
# @return [String] The description of the constraint when it fails.
|
59
63
|
def short_violation_description: ...
|
60
64
|
|
@@ -25,6 +25,8 @@ module Domainic
|
|
25
25
|
|
26
26
|
# Get a human-readable description of the uniqueness requirement.
|
27
27
|
#
|
28
|
+
# @deprecated this method will be removed in version 0.1.0
|
29
|
+
#
|
28
30
|
# @example
|
29
31
|
# constraint = UniquenessConstraint.new(:self)
|
30
32
|
# constraint.description # => "unique"
|
@@ -37,6 +39,8 @@ module Domainic
|
|
37
39
|
# This is used to help compose a error message when the constraint is not satisfied.
|
38
40
|
# Implementing classes can override this to provide more specific failure messages.
|
39
41
|
#
|
42
|
+
# @deprecated this method will be removed in version 0.1.0
|
43
|
+
#
|
40
44
|
# @return [String] The description of the constraint when it fails.
|
41
45
|
def short_violation_description: ...
|
42
46
|
|
@@ -79,6 +79,8 @@ module Domainic
|
|
79
79
|
|
80
80
|
# The aggregate description of all constraints in the set.
|
81
81
|
#
|
82
|
+
# @deprecated this method will be removed in version 0.1.0
|
83
|
+
#
|
82
84
|
# @return [String] The description of all constraints
|
83
85
|
def description: () -> String
|
84
86
|
|
@@ -133,6 +135,8 @@ module Domainic
|
|
133
135
|
|
134
136
|
# The aggregate violation description of all constraints in the set.
|
135
137
|
#
|
138
|
+
# @deprecated this method will be removed in version 0.1.0
|
139
|
+
#
|
136
140
|
# @return [String] The description of all constraints
|
137
141
|
def violation_description: () -> String
|
138
142
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: domainic-type
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.alpha.3.4.
|
4
|
+
version: 0.1.0.alpha.3.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Allen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Stop wrestling with complex type validations and unclear error messages.
|
14
14
|
Domainic::Type brings type validation to Ruby that is both powerful and delightful
|
@@ -162,16 +162,16 @@ files:
|
|
162
162
|
- sig/domainic/type/types/specification/union_type.rbs
|
163
163
|
- sig/domainic/type/types/specification/void_type.rbs
|
164
164
|
- sig/manifest.yaml
|
165
|
-
homepage: https://github.com/domainic/domainic/tree/domainic-type-v0.1.0-alpha.3.4.
|
165
|
+
homepage: https://github.com/domainic/domainic/tree/domainic-type-v0.1.0-alpha.3.4.1/domainic-type
|
166
166
|
licenses:
|
167
167
|
- MIT
|
168
168
|
metadata:
|
169
169
|
bug_tracker_uri: https://github.com/domainic/domainic/issues
|
170
|
-
changelog_uri: https://github.com/domainic/domainic/releases/tag/domainic-type-v0.1.0-alpha.3.4.
|
171
|
-
documentation_uri: https://rubydoc.info/gems/domainic-type/0.1.0.alpha.3.4.
|
172
|
-
homepage_uri: https://github.com/domainic/domainic/tree/domainic-type-v0.1.0-alpha.3.4.
|
170
|
+
changelog_uri: https://github.com/domainic/domainic/releases/tag/domainic-type-v0.1.0-alpha.3.4.1
|
171
|
+
documentation_uri: https://rubydoc.info/gems/domainic-type/0.1.0.alpha.3.4.1
|
172
|
+
homepage_uri: https://github.com/domainic/domainic/tree/domainic-type-v0.1.0-alpha.3.4.1/domainic-type
|
173
173
|
rubygems_mfa_required: 'true'
|
174
|
-
source_code_uri: https://github.com/domainic/domainic/tree/domainic-type-v0.1.0-alpha.3.4.
|
174
|
+
source_code_uri: https://github.com/domainic/domainic/tree/domainic-type-v0.1.0-alpha.3.4.1/domainic-type
|
175
175
|
post_install_message:
|
176
176
|
rdoc_options: []
|
177
177
|
require_paths:
|