annotate lib/IMPL/Web/ViewResult.pm @ 417:3ed0c58e9da3 ref20150831

working on di container, tests
author cin
date Mon, 02 Nov 2015 01:56:53 +0300
parents c6e90e02dd17
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
407
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
1 package IMPL::Web::ViewResult;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
2 use strict;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
3
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
4 use IMPL::Const qw(:prop);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
5 use Carp qw(carp);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
6
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
7 use IMPL::declare {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
8 base => [
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
9 'IMPL::Object' => undef,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
10 'IMPL::Object::Autofill' => '@_'
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
11 ],
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
12 props => [
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
13 model => PROP_RW,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
14 _location => PROP_RW,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
15 cookies => PROP_RW,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
16 headers => PROP_RW,
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
17 status => PROP_RW
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
18 ]
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
19 };
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
20
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
21 sub location {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
22 carp "location property is absolute";
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
23 return shift->_location(@_);
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
24 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
25
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
26 1;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
27
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
28 __END__
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
29
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
30 =pod
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
31
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
32 =head1 NAME
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
33
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
34 C<IMPL::Web::ViewResult> - описание представления результата.
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
35
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
36 =head1 SYNOPSIS
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
37
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
38 =begin code
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
39
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
40 sub HttpGet {
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
41 my ($this, $action) = @_;
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
42
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
43 return IMPL::Web::ViewResult->new(
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
44 model => $model
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
45 );
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
46 }
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
47
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
48 =end code
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
49
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
50 =head1 DESCRIPTION
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
51
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
52 Сожержит в себе информацию для представления модели. Также включает поля для
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
53 заголовков ответа C<cookies>, C<headers>, C<status>.
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
54
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
55 =head1 MEMBERS
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
56
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
57 =head2 C<[get,set]model>
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
58
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
59 Модель ресурса, как правило это результат выполнения C<Http> метода.
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
60
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
61 =head2 C<[get,set]cookies>
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
62
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
63 Хеш с печеньками, которые будут добавлены в C<HTTP> ответ.
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
64
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
65 =head2 C<[get,set]headers>
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
66
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
67 Заголовки которые нужно добавить в заголовки C<HTTP> ответа.
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
68
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
69 =head2 C<[get,set]status>
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
70
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
71 Код C<HTTP> ответа.
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
72
c6e90e02dd17 renamed Lib->lib
cin
parents:
diff changeset
73 =cut