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