X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lib%2FDebbugs%2FOOTypes.pm;fp=lib%2FDebbugs%2FOOTypes.pm;h=37473d0e1da7b8be348248d7eed0b1586329038e;hb=1e6633a3780f4fd53fc4303852e84d13cdad2dc6;hp=0000000000000000000000000000000000000000;hpb=466f7faff129a5699c7674f59900a92aa256175d;p=debbugs.git diff --git a/lib/Debbugs/OOTypes.pm b/lib/Debbugs/OOTypes.pm new file mode 100644 index 0000000..37473d0 --- /dev/null +++ b/lib/Debbugs/OOTypes.pm @@ -0,0 +1,58 @@ +# This module is part of debbugs, and +# is released under the terms of the GPL version 2, or any later +# version (at your option). See the file README and COPYING for more +# information. +# Copyright 2018 by Don Armstrong . + +package Debbugs::OOTypes; + +=head1 NAME + +Debbugs::OOTypes -- OO Types for Debbugs + +=head1 SYNOPSIS + + +=head1 DESCRIPTION + + + +=cut + +use Mouse::Util::TypeConstraints; +use strictures 2; +use namespace::autoclean; + +# Bug Subtype +subtype 'Bug' => + as 'Debbugs::Bug'; + +coerce 'Bug' => + from 'Int' => + via {Debbugs::Bug->new($_)}; + +# Package Subtype +subtype 'Package' => + as 'Debbugs::Package'; + +coerce 'Package' => + from 'Str' => + via {Debbugs::Package->new(package => $_)}; + + +# Version Subtype +subtype 'Version' => + as 'Debbugs::Version'; + +coerce 'Version' => + from 'Str' => + via {Debbugs::Version->new(string=>$_)}; + +no Mouse::Util::TypeConstraints; +1; + +__END__ +# Local Variables: +# indent-tabs-mode: nil +# cperl-indent-level: 4 +# End: