Mercurial > pub > Impl
comparison Lib/IMPL/declare.pm @ 230:6d8092d8ce1b
*reworked IMPL::Security
*reworked IMPL::Web::Security
*refactoring
| author | sergey |
|---|---|
| date | Mon, 08 Oct 2012 03:37:37 +0400 |
| parents | 431db7034a88 |
| children | 9f394b27dccf |
comparison
equal
deleted
inserted
replaced
| 229:47f77e6409f7 | 230:6d8092d8ce1b |
|---|---|
| 2 use strict; | 2 use strict; |
| 3 | 3 |
| 4 use Scalar::Util qw(set_prototype); | 4 use Scalar::Util qw(set_prototype); |
| 5 use Carp qw(carp); | 5 use Carp qw(carp); |
| 6 use IMPL::Class::PropertyInfo(); | 6 use IMPL::Class::PropertyInfo(); |
| 7 use IMPL::Const qw(:access); | |
| 7 | 8 |
| 8 sub import { | 9 sub import { |
| 9 my ( $self, $args ) = @_; | 10 my ( $self, $args ) = @_; |
| 10 | 11 |
| 11 return unless $args; | 12 return unless $args; |
| 50 | 51 |
| 51 push @isa, $class; | 52 push @isa, $class; |
| 52 $ctor{$class} = $mapper; | 53 $ctor{$class} = $mapper; |
| 53 } | 54 } |
| 54 } | 55 } |
| 56 | |
| 57 *{"${caller}::CTOR"} = \%ctor; | |
| 58 *{"${caller}::ISA"} = \@isa; | |
| 55 | 59 |
| 56 my $props = $args->{props} || []; | 60 my $props = $args->{props} || []; |
| 57 | 61 |
| 58 if ( $props eq 'HASH' ) { | 62 if ( $props eq 'HASH' ) { |
| 59 $props = [%$props]; | 63 $props = [%$props]; |
| 73 { | 77 { |
| 74 Name => $prop, | 78 Name => $prop, |
| 75 Mutators => $spec, | 79 Mutators => $spec, |
| 76 Class => $caller, | 80 Class => $caller, |
| 77 Access => $prop =~ /^_/ | 81 Access => $prop =~ /^_/ |
| 78 ? IMPL::Class::MemberInfo::MOD_PRIVATE | 82 ? ACCESS_PRIVATE |
| 79 : IMPL::Class::MemberInfo::MOD_PUBLIC | 83 : ACCESS_PUBLIC |
| 80 } | 84 } |
| 81 ); | 85 ); |
| 82 $propInfo->Implement(); | 86 $propInfo->Implement(); |
| 83 } | 87 } |
| 84 } | 88 } |
| 85 | |
| 86 *{"${caller}::CTOR"} = \%ctor; | |
| 87 *{"${caller}::ISA"} = \@isa; | |
| 88 } | 89 } |
| 89 | 90 |
| 90 sub _require { | 91 sub _require { |
| 91 my ($class) = @_; | 92 my ($class) = @_; |
| 92 | 93 |
