1JSON::Validator::URI(3)User Contributed Perl DocumentatioJnSON::Validator::URI(3)
2
3
4
6 JSON::Validator::URI - Uniform Resource Identifier
7
9 use JSON::Validator::URI;
10
11 my $urn = JSON::Validator::URI->new('urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f');
12 my $url = JSON::Validator::URI->new('/foo');
13 my $url = JSON::Validator::URI->new('https://mojolicious.org');
14
16 JSON::Validator::URI is a class for presenting both URL and URN.
17
18 This class is currently EXPERIMENTAL.
19
21 uri
22 $uri = uri;
23 $uri = uri $orig, $base;
24
25 Returns a new JSON::Validator::URI object from $orig and $base. Both
26 variables can be either a string or a JSON::Validator::URI object.
27
29 JSON::Validator::URI inherits all attributes from Mojo::URL and
30 implements the following ones.
31
32 nid
33 $str = $uri->nid;
34
35 Returns the NID part of a URN. Example "uuid" or "iban".
36
37 nss
38 $str = $uri->nss;
39
40 Returns the NSS part of a URN. Example
41 "6e8bc430-9c3a-11d9-9669-0800200c9a66".
42
44 JSON::Validator::URI inherits all methods from Mojo::URL and implements
45 the following ones.
46
47 from_data
48 $str = $uri->from_data($data);
49
50 This method will generate a URN for $data. $data will be serialized
51 using "encode_json" in Mojo::JSON before being used to generate an
52 UUIDv5.
53
54 This method is EXPERIMENTAL and subject to change!
55
56 parse
57 See "parse" in Mojo::URL.
58
59 to_abs
60 See "to_abs" in Mojo::URL.
61
62 to_string
63 See "to_string" in Mojo::URL.
64
65 to_unsafe_string
66 See "to_unsafe_string" in Mojo::URL.
67
69 JSON::Validator.
70
71
72
73perl v5.36.0 2022-07-22 JSON::Validator::URI(3)