/[Frey]/trunk/lib/Frey/Types.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Types.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 925 by dpavlin, Sat Aug 16 13:03:44 2008 UTC revision 926 by dpavlin, Mon Jan 5 22:10:59 2009 UTC
# Line 5  use URI (); Line 5  use URI ();
5    
6  subtype 'Uri'  subtype 'Uri'
7          => as 'Object'          => as 'Object'
8          => where { $_->isa('URI') };          => where { $_->isa('URI') }
9    ;
10        
11  coerce 'Uri'  coerce 'Uri'
12          => from 'Object'          => from 'Object'
# Line 13  coerce 'Uri' Line 14  coerce 'Uri'
14                  ? $_                  ? $_
15                  : Params::Coerce::coerce( 'URI', $_ ) }                  : Params::Coerce::coerce( 'URI', $_ ) }
16          => from 'Str'          => from 'Str'
17                  => via { URI->new( $_ ) };                  => via { URI->new( $_ ) }
18    ;
19    
20    type 'Sponge'
21            => where {
22                    defined $_->{rows} || die "no rows in sponge";
23                    defined $_->{NAME} || die "no NAME in sponge";
24            }
25    ;
26    
27  1;  1;

Legend:
Removed from v.925  
changed lines
  Added in v.926

  ViewVC Help
Powered by ViewVC 1.1.26