1Types::Namespace(3) User Contributed Perl Documentation Types::Namespace(3)
2
3
4
6 Types::Namespace - type constraints for dealing with namespaces
7
9 package Namespace::Counter {
10 use Moo; # or Moose
11 use Types::Namespace qw( Namespace );
12
13 has ns => (
14 is => "ro",
15 isa => Namespace,
16 required => 1,
17 );
18
19 sub count_uses_in_document { ... }
20 }
21
23 Types::Namespace is a type constraint library suitable for use with
24 Moo/Moose attributes, Kavorka sub signatures, and so forth. It builds
25 on Types::URI.
26
28 "Namespace"
29 A class type for URI::Namespace.
30
31 Can coerce from URI, IRI, Path::Tiny, and strings.
32
33 "NamespaceMap"
34 A class type for URI::NamespaceMap.
35
36 Can coerce from a hashref of "prefix => URI" pairs.
37
38 "Uri", "Iri"
39 These namespaces are re-exported from Types::URI, but with an
40 additional coercion from the "Namespace" type.
41
43 See URI::NamespaceMap for further details about authors, license, etc.
44
45
46
47perl v5.28.1 2019-04-15 Types::Namespace(3)