Mercurial > pub > Impl
annotate Lib/IMPL/Class/Member.pm @ 277:6585464c4664
sync (unstable)
author | sergey |
---|---|
date | Fri, 01 Feb 2013 16:37:59 +0400 |
parents | 8a5da17d7ef9 |
children | 4ddb27ff4a0b |
rev | line source |
---|---|
49 | 1 package IMPL::Class::Member; |
2 use strict; | |
165 | 3 use parent qw(Exporter); |
277 | 4 our @EXPORT = qw(&public &private &protected); |
49 | 5 |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
6 |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
7 use IMPL::Const qw(:access); |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
8 |
49 | 9 require IMPL::Class::MemberInfo; |
10 | |
11 sub public($) { | |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
12 my $info = shift; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
13 $info->{access} = ACCESS_PUBLIC; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
14 my ($class,$implementor) = delete $info->{'class','-implementor'}; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
15 $class->$implementor($info); |
49 | 16 } |
17 | |
18 sub private($) { | |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
19 my $info = shift; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
20 $info->{access} = ACCESS_PRIVATE; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
21 my ($class,$implementor) = delete $info->{'class','-implementor'}; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
22 $class->$implementor($info); |
49 | 23 } |
24 | |
25 sub protected($) { | |
276
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
26 my $info = shift; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
27 $info->{access} = ACCESS_PROTECTED; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
28 my ($class,$implementor) = delete $info->{'class','-implementor'}; |
8a5da17d7ef9
*IMPL::Class refactoring property definition mechanism (incomplete).
sergey
parents:
275
diff
changeset
|
29 $class->$implementor($info); |
49 | 30 } |
277 | 31 |
49 | 32 1; |