diff options
Diffstat (limited to 'lib/Types/URI.pm')
-rw-r--r-- | lib/Types/URI.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Types/URI.pm b/lib/Types/URI.pm new file mode 100644 index 0000000..0bb4ae5 --- /dev/null +++ b/lib/Types/URI.pm @@ -0,0 +1,15 @@ +package Types::URI; +use strict; +use warnings; +use namespace::autoclean; +use Type::Library -base, -declare => 'Uri'; +use Type::Utils -all; +use Types::Standard -types; + +class_type Uri, { class => 'URI' }; +coerce Uri, from Str, via { + require URI; + URI->new($_); +}; + +1; |