Mercurial > pub > Impl
comparison Lib/IMPL/declare.pm @ 256:32aceba4ee6d
corrected ViewHandlers to handle cookies and headers.
Dirty hacks to handle binary data
RestController doesn't deal with file extensions anymore.
| author | sergey |
|---|---|
| date | Wed, 12 Dec 2012 04:29:50 +0400 |
| parents | 34a3f8668b58 |
| children | 6253872024a4 |
comparison
equal
deleted
inserted
replaced
| 255:827cf96faa1c | 256:32aceba4ee6d |
|---|---|
| 87 | 87 |
| 88 carp "Odd elements number in properties declaration of $caller" | 88 carp "Odd elements number in properties declaration of $caller" |
| 89 unless scalar(@$props) % 2 == 0; | 89 unless scalar(@$props) % 2 == 0; |
| 90 | 90 |
| 91 if (@$props) { | 91 if (@$props) { |
| 92 for ( my $i = 0 ; $i < @$props - 1 ; $i = $i + 2 ) { | 92 $self->_implementProps($props,$caller); |
| 93 my ( $prop, $spec ) = @{$props}[ $i, $i + 1 ]; | 93 } |
| 94 | 94 |
| 95 my $propInfo = IMPL::Class::PropertyInfo->new( | 95 if ($args->{_implement}) { |
| 96 { | 96 $self->_implementProps($caller->abstractProps,$caller); |
| 97 Name => $prop, | 97 } |
| 98 Mutators => $spec, | |
| 99 Class => $caller, | |
| 100 Access => $prop =~ /^_/ | |
| 101 ? ACCESS_PRIVATE | |
| 102 : ACCESS_PUBLIC | |
| 103 } | |
| 104 ); | |
| 105 $propInfo->Implement(); | |
| 106 } | |
| 107 } | |
| 108 | 98 |
| 109 $IMPL::require::level--; | 99 $IMPL::require::level--; |
| 110 delete $IMPL::require::PENDING{$caller}; | 100 delete $IMPL::require::PENDING{$caller}; |
| 101 } | |
| 102 | |
| 103 sub _implementProps { | |
| 104 my ($self, $props, $caller) = @_; | |
| 105 | |
| 106 for ( my $i = 0 ; $i < @$props - 1 ; $i = $i + 2 ) { | |
| 107 my ( $prop, $spec ) = @{$props}[ $i, $i + 1 ]; | |
| 108 | |
| 109 my $propInfo = IMPL::Class::PropertyInfo->new( | |
| 110 { | |
| 111 Name => $prop, | |
| 112 Mutators => $spec, | |
| 113 Class => $caller, | |
| 114 Access => $prop =~ /^_/ | |
| 115 ? ACCESS_PRIVATE | |
| 116 : ACCESS_PUBLIC | |
| 117 } | |
| 118 ); | |
| 119 $propInfo->Implement(); | |
| 120 } | |
| 111 } | 121 } |
| 112 | 122 |
| 113 1; | 123 1; |
| 114 | 124 |
| 115 __END__ | 125 __END__ |
