1Declare::Constraints::SUismeprleC:o:nRtersiublutt(e3d)PDeercllaDroec:u:mCeonntsattriaoinnts::Simple::Result(3)
2
3
4
6 Declare::Constraints::Simple::Result - Validation Result
7
9 my $result = $constraint->($value);
10
11 my $message = $result->message;
12 my $path = $result->path;
13
15 This represents a result returned by a Declare::Constraints::Simple
16 constraint. Objects of this kind overload their boolean context, so the
17 value of the is_valid() accessor is reflected to it.
18
20 new()
21 Constructor. As you will mostly just receive result objects, you should
22 never be required to call this yourself.
23
24 set_valid($bool)
25 Sets the results validity flag.
26
27 is_valid()
28 Boolean accessor telling if this is a true result or not.
29
30 set_message($message)
31 The error message. Useful only on non-valid results.
32
33 message()
34 Returns the message of the result object.
35
36 add_to_stack($constraint_name)
37 This adds another level at the beginning (!) of the results constraint
38 stack. This is mostly intended to use for the "prepare_generator"method
39 in Declare::Constraints::Simple::Library package.
40
41 path([$separator])
42 Returns a string containing the stack() contents joined together by the
43 $separator string (defaulting to ".").
44
45 stack()
46 Returns an array reference containing the results currrent stack. This
47 is a list of the constraints path parts. This is usually just the
48 constraints name. If there's additional info, it is appended to the
49 name like "[$info]".
50
52 Declare::Constraints::Simple
53
55 Robert 'phaylon' Sedlacek "<phaylon@dunkelheit.at>"
56
58 This module is free software, you can redistribute it and/or modify it
59 under the same terms as perl itself.
60
61
62
63perl v5.32.0 2020-0D7e-c2l8are::Constraints::Simple::Result(3)