Parent Directory | Revision Log
introduce Sponge in Frey::Types to present tabular data [0.25]
1 | dpavlin | 174 | package Frey::Types; |
2 | use Moose::Util::TypeConstraints; | ||
3 | |||
4 | use URI (); | ||
5 | |||
6 | subtype 'Uri' | ||
7 | => as 'Object' | ||
8 | dpavlin | 926 | => where { $_->isa('URI') } |
9 | ; | ||
10 | dpavlin | 174 | |
11 | coerce 'Uri' | ||
12 | => from 'Object' | ||
13 | => via { $_->isa('URI') | ||
14 | ? $_ | ||
15 | : Params::Coerce::coerce( 'URI', $_ ) } | ||
16 | => from 'Str' | ||
17 | dpavlin | 926 | => via { URI->new( $_ ) } |
18 | ; | ||
19 | dpavlin | 174 | |
20 | dpavlin | 926 | type 'Sponge' |
21 | => where { | ||
22 | defined $_->{rows} || die "no rows in sponge"; | ||
23 | defined $_->{NAME} || die "no NAME in sponge"; | ||
24 | } | ||
25 | ; | ||
26 | |||
27 | dpavlin | 174 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |