Parent Directory | Revision Log
split types in own package, and added note about redundant code with MooseX::Types::URI (which I can't use correctly it seems)
1 | dpavlin | 174 | package Frey::Types; |
2 | use Moose::Util::TypeConstraints; | ||
3 | |||
4 | use URI (); | ||
5 | |||
6 | subtype 'Uri' | ||
7 | => as 'Object' | ||
8 | => where { $_->isa('URI') }; | ||
9 | |||
10 | coerce 'Uri' | ||
11 | => from 'Object' | ||
12 | => via { $_->isa('URI') | ||
13 | ? $_ | ||
14 | : Params::Coerce::coerce( 'URI', $_ ) } | ||
15 | => from 'Str' | ||
16 | => via { URI->new( $_ ) }; | ||
17 | |||
18 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |