Commit | Line | Data |
8a293e2e |
1 | package Reaction::UI::ViewPort::SiteLayout; |
2 | |
3 | use Reaction::Class; |
4 | use aliased 'Reaction::UI::ViewPort'; |
5 | |
81393881 |
6 | use namespace::clean -except => [ qw(meta) ]; |
7 | extends ViewPort; |
8a293e2e |
8 | |
05885573 |
9 | { |
10 | use Moose::Util::TypeConstraints qw/subtype where coerce from via/; |
8a293e2e |
11 | |
05885573 |
12 | my $str_type = subtype 'Str' => where { 1 }; |
13 | my $uri_type = subtype 'Object' => where { $_->isa('URI') }; |
8a293e2e |
14 | |
05885573 |
15 | coerce $str_type |
16 | => from $uri_type |
17 | => via { "$_[0]" }; |
18 | |
19 | has 'static_base_uri' => (isa => $str_type, coerce => 1, is => 'rw', lazy_fail => 1); |
81393881 |
20 | |
05885573 |
21 | no Moose::Util::TypeConstraints; |
22 | } |
23 | |
24 | has 'title' => (isa => 'Str', is => 'rw', lazy_fail => 1); |
81393881 |
25 | |
26 | has 'meta_info' => ( |
27 | is => 'rw', isa => 'HashRef', |
28 | required => '1', default => sub { {} } |
29 | ); |
30 | |
31 | __PACKAGE__->meta->make_immutable; |
414f3276 |
32 | |
8a293e2e |
33 | |
34 | 1; |