comparison Lib/IMPL/Web/RestContract.pm @ 212:292226770180

bugfixes
author sergey
date Fri, 29 Jun 2012 19:24:15 +0400
parents a9dbe534d236
children d6e2ea24af08
comparison
equal deleted inserted replaced
211:2b9b55cfb79b 212:292226770180
6 require => { 6 require => {
7 Exception => 'IMPL::Exception', 7 Exception => 'IMPL::Exception',
8 InvalidOpException => '-IMPL::InvalidOperationException', 8 InvalidOpException => '-IMPL::InvalidOperationException',
9 ForbiddenException => 'IMPL::Web::ForbiddenException', 9 ForbiddenException => 'IMPL::Web::ForbiddenException',
10 TRestResource => 'IMPL::Web::Application::RestResource', 10 TRestResource => 'IMPL::Web::Application::RestResource',
11 RestBaseResource => 'IMPL::Web::Application::RestBaseResource',
11 }, 12 },
12 base => { 13 base => {
13 'IMPL::Transform' => sub { my %args = @_; $args{resources} }, 14 'IMPL::Transform' => sub { my %args = @_; $args{resources} },
14 'IMPL::Object::Serializable' => undef 15 'IMPL::Object::Serializable' => undef
15 } 16 }
18 sub CTOR { 19 sub CTOR {
19 my ($this) = @_; 20 my ($this) = @_;
20 21
21 $this->templates->{-plain} = sub { die ForbiddenException->new(); }; 22 $this->templates->{-plain} = sub { die ForbiddenException->new(); };
22 $this->templates->{-default} = sub { die ForbiddenException->new(); }; 23 $this->templates->{-default} = sub { die ForbiddenException->new(); };
23 $this->templates->{TRestResource} = sub { $_[0] }; 24 $this->templates->{&RestBaseResource} = sub { $_[1] };
24 } 25 }
25 26
26 sub ProcessTemplate { 27 sub ProcessTemplate {
27 my ($this,$t,$obj,$props) = @_; 28 my ($this,$t,$obj,$props) = @_;
28 29
36 } else { 37 } else {
37 die InvalidOpException->new(); 38 die InvalidOpException->new();
38 } 39 }
39 } 40 }
40 41
41
42
43 1; 42 1;
44 43
45 __END__ 44 __END__
46 45
47 =pod 46 =pod
50 49
51 C<IMPL::Web::RestContract> Описывает правила публикации ресурсов. 50 C<IMPL::Web::RestContract> Описывает правила публикации ресурсов.
52 51
53 =head1 SYNOPSIS 52 =head1 SYNOPSIS
54 53
54
55
55 =begin code 56 =begin code
56 57
57 =end code 58 =end code
58 59
59 =cut 60 =cut